]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ktime: Cleanup ktime_set() usage
authorThomas Gleixner <tglx@linutronix.de>
Sun, 25 Dec 2016 11:30:41 +0000 (12:30 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 25 Dec 2016 16:21:22 +0000 (17:21 +0100)
ktime_set(S,N) was required for the timespec storage type and is still
useful for situations where a Seconds and Nanoseconds part of a time value
needs to be converted. For anything where the Seconds argument is 0, this
is pointless and can be replaced with a simple assignment.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
56 files changed:
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/oprofile/cell/spu_profiler.c
arch/s390/kvm/interrupt.c
arch/x86/kvm/lapic.c
block/blk-mq.c
drivers/base/power/main.c
drivers/base/power/wakeup.c
drivers/block/null_blk.c
drivers/dma/dmatest.c
drivers/gpu/drm/amd/amdgpu/dce_virtual.c
drivers/gpu/drm/i915/intel_uncore.c
drivers/gpu/drm/nouveau/nouveau_fence.c
drivers/gpu/drm/tilcdc/tilcdc_crtc.c
drivers/iio/trigger/iio-trig-hrtimer.c
drivers/input/joystick/walkera0701.c
drivers/mailbox/mailbox.c
drivers/media/dvb-core/dmxdev.c
drivers/media/pci/cx88/cx88-input.c
drivers/media/pci/pt3/pt3.c
drivers/net/can/softing/softing_fw.c
drivers/net/can/softing/softing_main.c
drivers/net/ethernet/ec_bhf.c
drivers/net/ethernet/marvell/mvpp2.c
drivers/net/ethernet/tile/tilegx.c
drivers/net/ieee802154/at86rf230.c
drivers/net/usb/cdc_ncm.c
drivers/net/wireless/ralink/rt2x00/rt2800usb.c
drivers/pci/quirks.c
drivers/platform/x86/msi-wmi.c
drivers/power/reset/ltc2952-poweroff.c
drivers/rtc/interface.c
drivers/s390/crypto/ap_bus.c
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
drivers/scsi/scsi_debug.c
drivers/scsi/ufs/ufshcd.c
drivers/usb/gadget/function/f_ncm.c
drivers/usb/host/ehci-timer.c
drivers/usb/host/fotg210-hcd.c
drivers/usb/musb/musb_cppi41.c
fs/dlm/lock.c
fs/gfs2/glock.c
fs/timerfd.c
include/linux/skbuff.h
kernel/sched/core.c
kernel/time/alarmtimer.c
kernel/time/hrtimer.c
kernel/time/posix-timers.c
kernel/time/tick-common.c
net/can/bcm.c
net/mac802154/util.c
net/sched/sch_cbq.c
net/sctp/transport.c
net/xfrm/xfrm_state.c
sound/drivers/pcsp/pcsp_lib.c
sound/firewire/lib.c
sound/sh/sh_dac_audio.c

index 66b2a35be424e0f158e93e273c11599e9de809aa..ec34e39471a78b3e60e2701f6a4e0bdf07b16de3 100644 (file)
@@ -1872,8 +1872,7 @@ static void kvmppc_set_timer(struct kvm_vcpu *vcpu)
        }
        dec_nsec = (vcpu->arch.dec_expires - now) * NSEC_PER_SEC
                   / tb_ticks_per_sec;
-       hrtimer_start(&vcpu->arch.dec_timer, ktime_set(0, dec_nsec),
-                     HRTIMER_MODE_REL);
+       hrtimer_start(&vcpu->arch.dec_timer, dec_nsec, HRTIMER_MODE_REL);
        vcpu->arch.timer_running = 1;
 }
 
index b19265de91784158abcb17c3e6fed4282c30bae6..5182f2936af2c8c718ee06e65a837d174fa88d19 100644 (file)
@@ -180,7 +180,7 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer)
        smp_wmb();      /* insure spu event buffer updates are written */
                        /* don't want events intermingled... */
 
-       kt = ktime_set(0, profiling_interval);
+       kt = profiling_interval;
        if (!spu_prof_running)
                goto stop;
        hrtimer_forward(timer, timer->base->get_time(), kt);
@@ -204,7 +204,7 @@ int start_spu_profiling_cycles(unsigned int cycles_reset)
        ktime_t kt;
 
        pr_debug("timer resolution: %lu\n", TICK_NSEC);
-       kt = ktime_set(0, profiling_interval);
+       kt = profiling_interval;
        hrtimer_init(&timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        hrtimer_set_expires(&timer, kt);
        timer.function = profile_spus;
index 6843dd5a1cbabba182b427e2ac74fc44a1f2fff6..0f8f14199734e94bd96ae0158be5c4a9a3c0333d 100644 (file)
@@ -1019,7 +1019,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
                return 0;
 
        __set_cpu_idle(vcpu);
-       hrtimer_start(&vcpu->arch.ckc_timer, ktime_set (0, sltime) , HRTIMER_MODE_REL);
+       hrtimer_start(&vcpu->arch.ckc_timer, sltime, HRTIMER_MODE_REL);
        VCPU_EVENT(vcpu, 4, "enabled wait: %llu ns", sltime);
 no_timer:
        srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
index 34a66b2d47e656b5be5c91c6d9e6fe0c93616ada..5fe290c1b7d892729e7cfd637433b8171423f407 100644 (file)
@@ -1106,7 +1106,7 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
        now = ktime_get();
        remaining = ktime_sub(apic->lapic_timer.target_expiration, now);
        if (ktime_to_ns(remaining) < 0)
-               remaining = ktime_set(0, 0);
+               remaining = 0;
 
        ns = mod_64(ktime_to_ns(remaining), apic->lapic_timer.period);
        tmcct = div64_u64(ns,
@@ -2057,7 +2057,7 @@ void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu)
                        apic->lapic_timer.tscdeadline = 0;
                if (apic_lvtt_oneshot(apic)) {
                        apic->lapic_timer.tscdeadline = 0;
-                       apic->lapic_timer.target_expiration = ktime_set(0, 0);
+                       apic->lapic_timer.target_expiration = 0;
                }
                atomic_set(&apic->lapic_timer.pending, 0);
        }
index 4bf850e8d6b5abf5a1f5252ab3bfe6dd10de6111..a8e67a155d04f6d937e890473b1647fbe95d210f 100644 (file)
@@ -2569,7 +2569,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
         * This will be replaced with the stats tracking code, using
         * 'avg_completion_time / 2' as the pre-sleep target.
         */
-       kt = ktime_set(0, nsecs);
+       kt = nsecs;
 
        mode = HRTIMER_MODE_REL;
        hrtimer_init_on_stack(&hs.timer, CLOCK_MONOTONIC, mode);
index 48c6294e9c342850cbc602c247d4cb27f2a65970..249e0304597f5bb6e4e48a26725bc712b1a5120b 100644 (file)
@@ -194,7 +194,7 @@ void device_pm_move_last(struct device *dev)
 
 static ktime_t initcall_debug_start(struct device *dev)
 {
-       ktime_t calltime = ktime_set(0, 0);
+       ktime_t calltime = 0;
 
        if (pm_print_times_enabled) {
                pr_info("calling  %s+ @ %i, parent: %s\n",
index 94332902a1cfeb17c65bf3d4bc3a387c0a610956..f546f8f107b06a456fc01738d1f8b2c6bcce1b53 100644 (file)
@@ -1005,7 +1005,7 @@ static int print_wakeup_source_stats(struct seq_file *m,
                        prevent_sleep_time = ktime_add(prevent_sleep_time,
                                ktime_sub(now, ws->start_prevent_time));
        } else {
-               active_time = ktime_set(0, 0);
+               active_time = 0;
        }
 
        seq_printf(m, "%-12s\t%lu\t\t%lu\t\t%lu\t\t%lu\t\t%lld\t\t%lld\t\t%lld\t\t%lld\t\t%lld\n",
index 4943ee22716e04a3b1427161f28ca9bafdd68a95..c0e14e54909b41b8f8e2f916be0d1169464ff643 100644 (file)
@@ -257,7 +257,7 @@ static enum hrtimer_restart null_cmd_timer_expired(struct hrtimer *timer)
 
 static void null_cmd_end_timer(struct nullb_cmd *cmd)
 {
-       ktime_t kt = ktime_set(0, completion_nsec);
+       ktime_t kt = completion_nsec;
 
        hrtimer_start(&cmd->timer, kt, HRTIMER_MODE_REL);
 }
index 451f899f74e4cb0129336b333fd09b7090da965c..c9297605058c1aa68aa0fa6d90f9a0fc1a6cdc0d 100644 (file)
@@ -429,8 +429,8 @@ static int dmatest_func(void *data)
        int                     dst_cnt;
        int                     i;
        ktime_t                 ktime, start, diff;
-       ktime_t                 filltime = ktime_set(0, 0);
-       ktime_t                 comparetime = ktime_set(0, 0);
+       ktime_t                 filltime = 0;
+       ktime_t                 comparetime = 0;
        s64                     runtime = 0;
        unsigned long long      total_len = 0;
        u8                      align = 0;
index e4a5a5ac0ff3042075e3bf8600a93016f008f662..762f8e82ceb7465f56aa8cfcd7124ce0fc28acda 100644 (file)
@@ -752,7 +752,7 @@ static enum hrtimer_restart dce_virtual_vblank_timer_handle(struct hrtimer *vbla
 
        drm_handle_vblank(ddev, amdgpu_crtc->crtc_id);
        dce_virtual_pageflip(adev, amdgpu_crtc->crtc_id);
-       hrtimer_start(vblank_timer, ktime_set(0, DCE_VIRTUAL_VBLANK_PERIOD),
+       hrtimer_start(vblank_timer, DCE_VIRTUAL_VBLANK_PERIOD,
                      HRTIMER_MODE_REL);
 
        return HRTIMER_NORESTART;
@@ -772,11 +772,11 @@ static void dce_virtual_set_crtc_vblank_interrupt_state(struct amdgpu_device *ad
                hrtimer_init(&adev->mode_info.crtcs[crtc]->vblank_timer,
                             CLOCK_MONOTONIC, HRTIMER_MODE_REL);
                hrtimer_set_expires(&adev->mode_info.crtcs[crtc]->vblank_timer,
-                                   ktime_set(0, DCE_VIRTUAL_VBLANK_PERIOD));
+                                   DCE_VIRTUAL_VBLANK_PERIOD);
                adev->mode_info.crtcs[crtc]->vblank_timer.function =
                        dce_virtual_vblank_timer_handle;
                hrtimer_start(&adev->mode_info.crtcs[crtc]->vblank_timer,
-                             ktime_set(0, DCE_VIRTUAL_VBLANK_PERIOD), HRTIMER_MODE_REL);
+                             DCE_VIRTUAL_VBLANK_PERIOD, HRTIMER_MODE_REL);
        } else if (!state && adev->mode_info.crtcs[crtc]->vsync_timer_enabled) {
                DRM_DEBUG("Disable software vsync timer\n");
                hrtimer_cancel(&adev->mode_info.crtcs[crtc]->vblank_timer);
index d7be0d94ba4d1786443230d19b01b6df1fcc3cde..0bffd3f0c15d796627d5d89a5775e5da7a0bf572 100644 (file)
@@ -62,7 +62,7 @@ fw_domain_arm_timer(struct intel_uncore_forcewake_domain *d)
 {
        d->wake_count++;
        hrtimer_start_range_ns(&d->timer,
-                              ktime_set(0, NSEC_PER_MSEC),
+                              NSEC_PER_MSEC,
                               NSEC_PER_MSEC,
                               HRTIMER_MODE_REL);
 }
index f2f348f0160c845d628cfdb0fa85e76cf4f4f490..a6126c93f215b0118e2c152cd0ad18d87c6f62ea 100644 (file)
@@ -330,7 +330,7 @@ nouveau_fence_wait_legacy(struct dma_fence *f, bool intr, long wait)
                __set_current_state(intr ? TASK_INTERRUPTIBLE :
                                           TASK_UNINTERRUPTIBLE);
 
-               kt = ktime_set(0, sleep_time);
+               kt = sleep_time;
                schedule_hrtimeout(&kt, HRTIMER_MODE_REL);
                sleep_time *= 2;
                if (sleep_time > NSEC_PER_MSEC)
index 9942b0577d6e556a2fce45b1d66c3ac410bf5c37..725dffad5640cddf43d6aea4616cd90a035c40bc 100644 (file)
@@ -539,7 +539,7 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown)
        }
 
        drm_flip_work_commit(&tilcdc_crtc->unref_work, priv->wq);
-       tilcdc_crtc->last_vblank = ktime_set(0, 0);
+       tilcdc_crtc->last_vblank = 0;
 
        tilcdc_crtc->enabled = false;
        mutex_unlock(&tilcdc_crtc->enable_lock);
index 5e6d451febebda26f97599f5c6c607561ef3e983..a1cad6cc2e0ff1bc70ca99d8d315eccdd5acb7d3 100644 (file)
@@ -63,7 +63,7 @@ ssize_t iio_hrtimer_store_sampling_frequency(struct device *dev,
                return -EINVAL;
 
        info->sampling_frequency = val;
-       info->period = ktime_set(0, NSEC_PER_SEC / val);
+       info->period = NSEC_PER_SEC / val;
 
        return len;
 }
@@ -141,8 +141,7 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name)
        trig_info->timer.function = iio_hrtimer_trig_handler;
 
        trig_info->sampling_frequency = HRTIMER_DEFAULT_SAMPLING_FREQUENCY;
-       trig_info->period = ktime_set(0, NSEC_PER_SEC /
-                                     trig_info->sampling_frequency);
+       trig_info->period = NSEC_PER_SEC / trig_info->sampling_frequency;
 
        ret = iio_trigger_register(trig_info->swt.trigger);
        if (ret)
index 70a893a17467608a103a81546eb7cce4cdf44010..36a5b93156ed88b048159f4bc02ddc9d4242b9ef 100644 (file)
@@ -165,7 +165,7 @@ static void walkera0701_irq_handler(void *handler_data)
                                RESERVE + BIN1_PULSE - BIN0_PULSE)      /* frame sync .. */
                w->counter = 0;
 
-       hrtimer_start(&w->timer, ktime_set(0, BIN_SAMPLE), HRTIMER_MODE_REL);
+       hrtimer_start(&w->timer, BIN_SAMPLE, HRTIMER_MODE_REL);
 }
 
 static enum hrtimer_restart timer_handler(struct hrtimer
index 4a36632c236f09ad9cdde06ff213961c712c3000..4671f8a128723010dafe2d2f6f48df75a492c9fb 100644 (file)
@@ -87,8 +87,7 @@ exit:
 
        if (!err && (chan->txdone_method & TXDONE_BY_POLL))
                /* kick start the timer immediately to avoid delays */
-               hrtimer_start(&chan->mbox->poll_hrt, ktime_set(0, 0),
-                             HRTIMER_MODE_REL);
+               hrtimer_start(&chan->mbox->poll_hrt, 0, HRTIMER_MODE_REL);
 }
 
 static void tx_tick(struct mbox_chan *chan, int r)
index 0c44479b556ec665ba4e84acd686a212b37c0484..0c16bb21310109050f461979306408f7ca42866b 100644 (file)
@@ -562,7 +562,7 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev,
                                 struct dmxdev_filter *filter,
                                 struct dmxdev_feed *feed)
 {
-       ktime_t timeout = ktime_set(0, 0);
+       ktime_t timeout = 0;
        struct dmx_pes_filter_params *para = &filter->params.pes;
        dmx_output_t otype;
        int ret;
index dcfea3502e42c53d47f03f4112ba117fa03ab0ac..c7b3cb406499b0b7d0319f64cc0891e03bcd485a 100644 (file)
@@ -178,8 +178,7 @@ static enum hrtimer_restart cx88_ir_work(struct hrtimer *timer)
        struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer);
 
        cx88_ir_handle_key(ir);
-       missed = hrtimer_forward_now(&ir->timer,
-                                    ktime_set(0, ir->polling * 1000000));
+       missed = hrtimer_forward_now(&ir->timer, ir->polling * 1000000);
        if (missed > 1)
                ir_dprintk("Missed ticks %ld\n", missed - 1);
 
@@ -199,8 +198,7 @@ static int __cx88_ir_start(void *priv)
        if (ir->polling) {
                hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
                ir->timer.function = cx88_ir_work;
-               hrtimer_start(&ir->timer,
-                             ktime_set(0, ir->polling * 1000000),
+               hrtimer_start(&ir->timer, ir->polling * 1000000,
                              HRTIMER_MODE_REL);
        }
        if (ir->sampling) {
index 7fb649e523f46e543cdc18284068f47c3827c20f..77f4d15f322b2d73e4cf25691ced9fd8f65c261f 100644 (file)
@@ -463,7 +463,7 @@ static int pt3_fetch_thread(void *data)
 
                pt3_proc_dma(adap);
 
-               delay = ktime_set(0, PT3_FETCH_DELAY * NSEC_PER_MSEC);
+               delay = PT3_FETCH_DELAY * NSEC_PER_MSEC;
                set_current_state(TASK_UNINTERRUPTIBLE);
                freezable_schedule_hrtimeout_range(&delay,
                                        PT3_FETCH_DELAY_DELTA * NSEC_PER_MSEC,
index 52fe50725d749665b629ad9a78e6447d14b60cf4..4063215c9b54b0bd4f6a4975037f2983e03f554c 100644 (file)
@@ -390,7 +390,7 @@ static void softing_initialize_timestamp(struct softing *card)
        ovf = 0x100000000ULL * 16;
        do_div(ovf, card->pdat->freq ?: 16);
 
-       card->ts_overflow = ktime_add_us(ktime_set(0, 0), ovf);
+       card->ts_overflow = ktime_add_us(0, ovf);
 }
 
 ktime_t softing_raw2ktime(struct softing *card, u32 raw)
@@ -647,7 +647,7 @@ int softing_startstop(struct net_device *dev, int up)
                open_candev(netdev);
                if (dev != netdev) {
                        /* notify other busses on the restart */
-                       softing_netdev_rx(netdev, &msg, ktime_set(0, 0));
+                       softing_netdev_rx(netdev, &msg, 0);
                        ++priv->can.can_stats.restarts;
                }
                netif_wake_queue(netdev);
index 7621f91a8a209e9de74d55de14fbb31947c449ee..5f64deec9f6c1c4d7ef2ca2eb64d385a3da41df4 100644 (file)
@@ -192,7 +192,7 @@ static int softing_handle_1(struct softing *card)
                                /* a dead bus has no overflows */
                                continue;
                        ++netdev->stats.rx_over_errors;
-                       softing_netdev_rx(netdev, &msg, ktime_set(0, 0));
+                       softing_netdev_rx(netdev, &msg, 0);
                }
                /* prepare for other use */
                memset(&msg, 0, sizeof(msg));
index 57650953ff83e127ecdcb3e606114d619d49db18..7bf78a0d322cc0efe9c4c793359ae5980b55e29d 100644 (file)
@@ -253,7 +253,7 @@ static enum hrtimer_restart ec_bhf_timer_fun(struct hrtimer *timer)
        if (!netif_running(priv->net_dev))
                return HRTIMER_NORESTART;
 
-       hrtimer_forward_now(timer, ktime_set(0, polling_frequency));
+       hrtimer_forward_now(timer, polling_frequency);
        return HRTIMER_RESTART;
 }
 
@@ -427,8 +427,7 @@ static int ec_bhf_open(struct net_device *net_dev)
 
        hrtimer_init(&priv->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        priv->hrtimer.function = ec_bhf_timer_fun;
-       hrtimer_start(&priv->hrtimer, ktime_set(0, polling_frequency),
-                     HRTIMER_MODE_REL);
+       hrtimer_start(&priv->hrtimer, polling_frequency, HRTIMER_MODE_REL);
 
        return 0;
 
index cda04b3126bc688222eaebed0fbe5c59aa76f89b..4fe430ceb194519ba87c2360479e27c7ceb0ebda 100644 (file)
@@ -4913,7 +4913,7 @@ static void mvpp2_timer_set(struct mvpp2_port_pcpu *port_pcpu)
 
        if (!port_pcpu->timer_scheduled) {
                port_pcpu->timer_scheduled = true;
-               interval = ktime_set(0, MVPP2_TXDONE_HRTIMER_PERIOD_NS);
+               interval = MVPP2_TXDONE_HRTIMER_PERIOD_NS;
                hrtimer_start(&port_pcpu->tx_done_timer, interval,
                              HRTIMER_MODE_REL_PINNED);
        }
index 0aaf975bb3470cfdc6fb218058fc2d8f0e87959d..2255f9a6f3bc28ee0d712b464137ecc7784e1c2f 100644 (file)
@@ -751,7 +751,7 @@ static void tile_net_schedule_tx_wake_timer(struct net_device *dev,
                &info->mpipe[instance].tx_wake[priv->echannel];
 
        hrtimer_start(&tx_wake->timer,
-                     ktime_set(0, TX_TIMER_DELAY_USEC * 1000UL),
+                     TX_TIMER_DELAY_USEC * 1000UL,
                      HRTIMER_MODE_REL_PINNED);
 }
 
@@ -770,7 +770,7 @@ static void tile_net_schedule_egress_timer(void)
 
        if (!info->egress_timer_scheduled) {
                hrtimer_start(&info->egress_timer,
-                             ktime_set(0, EGRESS_TIMER_DELAY_USEC * 1000UL),
+                             EGRESS_TIMER_DELAY_USEC * 1000UL,
                              HRTIMER_MODE_REL_PINNED);
                info->egress_timer_scheduled = true;
        }
index 057025722e3d006f4e78b0a53c20bec0440a726b..46d53a6c8cf868a18ab82a27e730c36e1bc6fb0b 100644 (file)
@@ -510,7 +510,7 @@ at86rf230_async_state_delay(void *context)
        case STATE_TRX_OFF:
                switch (ctx->to_state) {
                case STATE_RX_AACK_ON:
-                       tim = ktime_set(0, c->t_off_to_aack * NSEC_PER_USEC);
+                       tim = c->t_off_to_aack * NSEC_PER_USEC;
                        /* state change from TRX_OFF to RX_AACK_ON to do a
                         * calibration, we need to reset the timeout for the
                         * next one.
@@ -519,7 +519,7 @@ at86rf230_async_state_delay(void *context)
                        goto change;
                case STATE_TX_ARET_ON:
                case STATE_TX_ON:
-                       tim = ktime_set(0, c->t_off_to_tx_on * NSEC_PER_USEC);
+                       tim = c->t_off_to_tx_on * NSEC_PER_USEC;
                        /* state change from TRX_OFF to TX_ON or ARET_ON to do
                         * a calibration, we need to reset the timeout for the
                         * next one.
@@ -539,8 +539,7 @@ at86rf230_async_state_delay(void *context)
                         * to TX_ON or TRX_OFF.
                         */
                        if (!force) {
-                               tim = ktime_set(0, (c->t_frame + c->t_p_ack) *
-                                                  NSEC_PER_USEC);
+                               tim = (c->t_frame + c->t_p_ack) * NSEC_PER_USEC;
                                goto change;
                        }
                        break;
@@ -552,7 +551,7 @@ at86rf230_async_state_delay(void *context)
        case STATE_P_ON:
                switch (ctx->to_state) {
                case STATE_TRX_OFF:
-                       tim = ktime_set(0, c->t_reset_to_off * NSEC_PER_USEC);
+                       tim = c->t_reset_to_off * NSEC_PER_USEC;
                        goto change;
                default:
                        break;
index 2d1a6f2e16ab811283b0864f6fa551a5572096f3..f317984f75360141ee606b8ca31b78baa853a1d5 100644 (file)
@@ -1282,7 +1282,7 @@ static void cdc_ncm_tx_timeout_start(struct cdc_ncm_ctx *ctx)
        /* start timer, if not already started */
        if (!(hrtimer_active(&ctx->tx_timer) || atomic_read(&ctx->stop)))
                hrtimer_start(&ctx->tx_timer,
-                               ktime_set(0, ctx->timer_interval),
+                               ctx->timer_interval,
                                HRTIMER_MODE_REL);
 }
 
index 9f61293f1a5683fd6dc8042c273a64944d8061c8..f38c44061b5ba664f832d62b4a899b8a80568b1f 100644 (file)
@@ -177,7 +177,7 @@ static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev,
        if (rt2800usb_txstatus_pending(rt2x00dev)) {
                /* Read register after 1 ms */
                hrtimer_start(&rt2x00dev->txstatus_timer,
-                             ktime_set(0, TXSTATUS_READ_INTERVAL),
+                             TXSTATUS_READ_INTERVAL,
                              HRTIMER_MODE_REL);
                return false;
        }
@@ -204,7 +204,7 @@ static void rt2800usb_async_read_tx_status(struct rt2x00_dev *rt2x00dev)
 
        /* Read TX_STA_FIFO register after 2 ms */
        hrtimer_start(&rt2x00dev->txstatus_timer,
-                     ktime_set(0, 2*TXSTATUS_READ_INTERVAL),
+                     2 * TXSTATUS_READ_INTERVAL,
                      HRTIMER_MODE_REL);
 }
 
index 9236e40ac05592f37eb895fe2b5ea5ef7bee6290..1800befa8b8baa1ca87052b7a4dc4e36cde9b2d8 100644 (file)
@@ -3044,7 +3044,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb);
 static ktime_t fixup_debug_start(struct pci_dev *dev,
                                 void (*fn)(struct pci_dev *dev))
 {
-       ktime_t calltime = ktime_set(0, 0);
+       ktime_t calltime = 0;
 
        dev_dbg(&dev->dev, "calling %pF\n", fn);
        if (initcall_debug) {
index 978e6d6405729cb32391f73c65ac23a1b0eeebef..9a32f8627eccfd2054e96ec895234c0ca29cd70d 100644 (file)
@@ -283,7 +283,7 @@ static int __init msi_wmi_input_setup(void)
        if (err)
                goto err_free_keymap;
 
-       last_pressed = ktime_set(0, 0);
+       last_pressed = 0;
 
        return 0;
 
index 15fed9d8f871a715dfada3dd22b8ca0e461dd66a..bfcd6fba6363bc01e5db313d6094dc1573424dd0 100644 (file)
@@ -169,7 +169,7 @@ static void ltc2952_poweroff_kill(void)
 
 static void ltc2952_poweroff_default(struct ltc2952_poweroff *data)
 {
-       data->wde_interval = ktime_set(0, 300L*1E6L);
+       data->wde_interval = 300L * 1E6L;
        data->trigger_delay = ktime_set(2, 500L*1E6L);
 
        hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
index 5cf196dfc19368de1aeb64d8de52eb63c3207afd..fc0fa7577636dab1c02c3a34ea9e2c18b3255bfd 100644 (file)
@@ -363,7 +363,7 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
                rtc_timer_remove(rtc, &rtc->aie_timer);
 
        rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time);
-       rtc->aie_timer.period = ktime_set(0, 0);
+       rtc->aie_timer.period = 0;
        if (alarm->enabled)
                err = rtc_timer_enqueue(rtc, &rtc->aie_timer);
 
@@ -391,7 +391,7 @@ int rtc_initialize_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
                return err;
 
        rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time);
-       rtc->aie_timer.period = ktime_set(0, 0);
+       rtc->aie_timer.period = 0;
 
        /* Alarm has to be enabled & in the future for us to enqueue it */
        if (alarm->enabled && (rtc_tm_to_ktime(now) <
@@ -554,7 +554,7 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer)
        int count;
        rtc = container_of(timer, struct rtc_device, pie_timer);
 
-       period = ktime_set(0, NSEC_PER_SEC/rtc->irq_freq);
+       period = NSEC_PER_SEC / rtc->irq_freq;
        count = hrtimer_forward_now(timer, period);
 
        rtc_handle_legacy_irq(rtc, count, RTC_PF);
@@ -665,7 +665,7 @@ static int rtc_update_hrtimer(struct rtc_device *rtc, int enabled)
                return -1;
 
        if (enabled) {
-               ktime_t period = ktime_set(0, NSEC_PER_SEC / rtc->irq_freq);
+               ktime_t period = NSEC_PER_SEC / rtc->irq_freq;
 
                hrtimer_start(&rtc->pie_timer, period, HRTIMER_MODE_REL);
        }
index 6d75984a3d85f29c464ddcc384839968a6633fb2..5fa6991928647971ef52047dad1294455219ada8 100644 (file)
@@ -333,7 +333,7 @@ void ap_wait(enum ap_wait wait)
        case AP_WAIT_TIMEOUT:
                spin_lock_bh(&ap_poll_timer_lock);
                if (!hrtimer_is_queued(&ap_poll_timer)) {
-                       hr_time = ktime_set(0, poll_timeout);
+                       hr_time = poll_timeout;
                        hrtimer_forward_now(&ap_poll_timer, hr_time);
                        hrtimer_restart(&ap_poll_timer);
                }
@@ -860,7 +860,7 @@ static ssize_t poll_timeout_store(struct bus_type *bus, const char *buf,
            time > 120000000000ULL)
                return -EINVAL;
        poll_timeout = time;
-       hr_time = ktime_set(0, poll_timeout);
+       hr_time = poll_timeout;
 
        spin_lock_bh(&ap_poll_timer_lock);
        hrtimer_cancel(&ap_poll_timer);
index 2583e8b50b21c2cfa6ec3d10e624adb8141d5c9d..3d3768aaab4f2bb79ccbaf40f1f569114e4f9b30 100644 (file)
@@ -1694,7 +1694,7 @@ static void srp_snd_msg_failed(struct scsi_info *vscsi, long rc)
                if (!vscsi->rsp_q_timer.started) {
                        if (vscsi->rsp_q_timer.timer_pops <
                            MAX_TIMER_POPS) {
-                               kt = ktime_set(0, WAIT_NANO_SECONDS);
+                               kt = WAIT_NANO_SECONDS;
                        } else {
                                /*
                                 * slide the timeslice if the maximum
index cf04a364fd8b35f869c31e44491d237ae1b3bc6e..03051e12a0721ec0632ebca9f66538c295844479 100644 (file)
@@ -4085,7 +4085,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
                        jiffies_to_timespec(delta_jiff, &ts);
                        kt = ktime_set(ts.tv_sec, ts.tv_nsec);
                } else
-                       kt = ktime_set(0, sdebug_ndelay);
+                       kt = sdebug_ndelay;
                if (NULL == sd_dp) {
                        sd_dp = kzalloc(sizeof(*sd_dp), GFP_ATOMIC);
                        if (NULL == sd_dp)
index a2c2817fc566911e59f019d91639260d2df2fa09..20e5e5fb048cddbb3df34e06723adfa083083835 100644 (file)
@@ -930,7 +930,7 @@ static void ufshcd_clk_scaling_update_busy(struct ufs_hba *hba)
        if (!hba->outstanding_reqs && scaling->is_busy_started) {
                scaling->tot_busy_t += ktime_to_us(ktime_sub(ktime_get(),
                                        scaling->busy_start_t));
-               scaling->busy_start_t = ktime_set(0, 0);
+               scaling->busy_start_t = 0;
                scaling->is_busy_started = false;
        }
 }
@@ -6661,7 +6661,7 @@ start_window:
                scaling->busy_start_t = ktime_get();
                scaling->is_busy_started = true;
        } else {
-               scaling->busy_start_t = ktime_set(0, 0);
+               scaling->busy_start_t = 0;
                scaling->is_busy_started = false;
        }
        spin_unlock_irqrestore(hba->host->host_lock, flags);
index e8008fa35e1e69c354ba35c510b1019e7a560c44..224717e63a5300970867a663cd030d8cd62068f6 100644 (file)
@@ -1113,8 +1113,7 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port,
                }
 
                /* Delay the timer. */
-               hrtimer_start(&ncm->task_timer,
-                             ktime_set(0, TX_TIMEOUT_NSECS),
+               hrtimer_start(&ncm->task_timer, TX_TIMEOUT_NSECS,
                              HRTIMER_MODE_REL);
 
                /* Add the datagram position entries */
index 262e10cacc8c0832061aa0246971ddfe501c4627..3893b5bafd8725a00ec4b32335a83c53fcef33a9 100644 (file)
@@ -88,8 +88,7 @@ static void ehci_enable_event(struct ehci_hcd *ehci, unsigned event,
        ktime_t         *timeout = &ehci->hr_timeouts[event];
 
        if (resched)
-               *timeout = ktime_add(ktime_get(),
-                               ktime_set(0, event_delays_ns[event]));
+               *timeout = ktime_add(ktime_get(), event_delays_ns[event]);
        ehci->enabled_hrtimer_events |= (1 << event);
 
        /* Track only the lowest-numbered pending event */
index 4dda56ef06cd2b13c7ce820a443b97052701dac9..9d0b0518290a1d596f7018216bc694d5bbc037b1 100644 (file)
@@ -1080,8 +1080,7 @@ static void fotg210_enable_event(struct fotg210_hcd *fotg210, unsigned event,
        ktime_t *timeout = &fotg210->hr_timeouts[event];
 
        if (resched)
-               *timeout = ktime_add(ktime_get(),
-                               ktime_set(0, event_delays_ns[event]));
+               *timeout = ktime_add(ktime_get(), event_delays_ns[event]);
        fotg210->enabled_hrtimer_events |= (1 << event);
 
        /* Track only the lowest-numbered pending event */
index d4d7c56b48c7edf70aba49d6c2b9aa04347acd7c..16363852c0346b28b6452e04eddedfc630635428 100644 (file)
@@ -197,8 +197,7 @@ static enum hrtimer_restart cppi41_recheck_tx_req(struct hrtimer *timer)
        if (!list_empty(&controller->early_tx_list) &&
            !hrtimer_is_queued(&controller->early_tx)) {
                ret = HRTIMER_RESTART;
-               hrtimer_forward_now(&controller->early_tx,
-                               ktime_set(0, 20 * NSEC_PER_USEC));
+               hrtimer_forward_now(&controller->early_tx, 20 * NSEC_PER_USEC);
        }
 
        spin_unlock_irqrestore(&musb->lock, flags);
@@ -280,9 +279,9 @@ static void cppi41_dma_callback(void *private_data)
                unsigned long usecs = cppi41_channel->total_len / 10;
 
                hrtimer_start_range_ns(&controller->early_tx,
-                               ktime_set(0, usecs * NSEC_PER_USEC),
-                               20 * NSEC_PER_USEC,
-                               HRTIMER_MODE_REL);
+                                      usecs * NSEC_PER_USEC,
+                                      20 * NSEC_PER_USEC,
+                                      HRTIMER_MODE_REL);
        }
 
 out:
index 35502d4046f573fac4909cceec1117ef033338e6..f631a70407f676bb836a4302b0d4a8e33dd4158a 100644 (file)
@@ -1395,7 +1395,7 @@ static int nodeid_warned(int nodeid, int num_nodes, int *warned)
 void dlm_scan_waiters(struct dlm_ls *ls)
 {
        struct dlm_lkb *lkb;
-       ktime_t zero = ktime_set(0, 0);
+       ktime_t zero = 0;
        s64 us;
        s64 debug_maxus = 0;
        u32 debug_scanned = 0;
index f7b3ba61add59326e14bf9ddb6a011adae2dc4df..94f50cac91c617b03025d4d596d8d9d65d2c185b 100644 (file)
@@ -695,7 +695,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
        gl->gl_target = LM_ST_UNLOCKED;
        gl->gl_demote_state = LM_ST_EXCLUSIVE;
        gl->gl_ops = glops;
-       gl->gl_dstamp = ktime_set(0, 0);
+       gl->gl_dstamp = 0;
        preempt_disable();
        /* We use the global stats to estimate the initial per-glock stats */
        gl->gl_stats = this_cpu_ptr(sdp->sd_lkstats)->lkstats[glops->go_type];
index fb4407a7cf9e8c4ebdd5ddfcc74c54fc06feac58..c173cc196175b4e4f72a6553b0faba67cdead250 100644 (file)
@@ -155,7 +155,7 @@ static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
        else
                remaining = hrtimer_expires_remaining_adjusted(&ctx->t.tmr);
 
-       return remaining < 0 ? ktime_set(0, 0): remaining;
+       return remaining < 0 ? 0: remaining;
 }
 
 static int timerfd_setup(struct timerfd_ctx *ctx, int flags,
index ac7fa34db8a7183b0b68176f8d6748346c288207..b53c0cfd417e3bec1c5cfab76787901bafa5884c 100644 (file)
@@ -3227,7 +3227,7 @@ static inline ktime_t net_timedelta(ktime_t t)
 
 static inline ktime_t net_invalid_timestamp(void)
 {
-       return ktime_set(0, 0);
+       return 0;
 }
 
 struct sk_buff *skb_clone_sk(struct sk_buff *skb);
index 966556ebdbb3fd68c272c8bc1cbffde252d4de45..c56fb57f2991ef4f2a68395c534b32d3053ae208 100644 (file)
@@ -1456,7 +1456,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
                 * yield - it could be a while.
                 */
                if (unlikely(queued)) {
-                       ktime_t to = ktime_set(0, NSEC_PER_SEC/HZ);
+                       ktime_t to = NSEC_PER_SEC / HZ;
 
                        set_current_state(TASK_UNINTERRUPTIBLE);
                        schedule_hrtimeout(&to, HRTIMER_MODE_REL);
index ab6ac077bdb7c5de2e40054809faec0b38a8fa22..e6dc9a538efa21163186e7292a6c312b6a7bc82a 100644 (file)
@@ -234,7 +234,7 @@ static int alarmtimer_suspend(struct device *dev)
        min = freezer_delta;
        expires = freezer_expires;
        type = freezer_alarmtype;
-       freezer_delta = ktime_set(0, 0);
+       freezer_delta = 0;
        spin_unlock_irqrestore(&freezer_delta_lock, flags);
 
        rtc = alarmtimer_get_rtcdev();
@@ -277,7 +277,7 @@ static int alarmtimer_suspend(struct device *dev)
        now = ktime_add(now, min);
 
        /* Set alarm, if in the past reject suspend briefly to handle */
-       ret = rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0));
+       ret = rtc_timer_start(rtc, &rtctimer, now, 0);
        if (ret < 0)
                __pm_wakeup_event(ws, MSEC_PER_SEC);
        return ret;
index c7f780113884870d0a965f63f64faf4b6fb2ed20..c6ecedd3b8393d4b3f4fc3b5cce41ebbffd375cd 100644 (file)
@@ -955,7 +955,7 @@ static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim,
         */
        timer->is_rel = mode & HRTIMER_MODE_REL;
        if (timer->is_rel)
-               tim = ktime_add_safe(tim, ktime_set(0, hrtimer_resolution));
+               tim = ktime_add_safe(tim, hrtimer_resolution);
 #endif
        return tim;
 }
index 9fe98b3777a2bec9d8c45d9a17eae966025e78ba..1e6623d7675019ae9c1dcc3dc273c03d761d5931 100644 (file)
@@ -485,7 +485,7 @@ static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer)
                         */
 #ifdef CONFIG_HIGH_RES_TIMERS
                        {
-                               ktime_t kj = ktime_set(0, NSEC_PER_SEC / HZ);
+                               ktime_t kj = NSEC_PER_SEC / HZ;
 
                                if (timr->it.real.interval < kj)
                                        now = ktime_add(now, kj);
index 4fcd99e12aa01ce3ce0fa24fb219d644a68417a3..49edc1c4f3e645894f839c40489ab81594a02398 100644 (file)
@@ -178,8 +178,8 @@ static void tick_setup_device(struct tick_device *td,
                              struct clock_event_device *newdev, int cpu,
                              const struct cpumask *cpumask)
 {
-       ktime_t next_event;
        void (*handler)(struct clock_event_device *) = NULL;
+       ktime_t next_event = 0;
 
        /*
         * First device setup ?
@@ -195,7 +195,7 @@ static void tick_setup_device(struct tick_device *td,
                        else
                                tick_do_timer_cpu = TICK_DO_TIMER_NONE;
                        tick_next_period = ktime_get();
-                       tick_period = ktime_set(0, NSEC_PER_SEC / HZ);
+                       tick_period = NSEC_PER_SEC / HZ;
                }
 
                /*
index ab8ba1e16473116c39547ab27118c3a177145c36..21ac75390e3d64f795faad074b515d34ce0bbfa3 100644 (file)
@@ -643,7 +643,7 @@ static enum hrtimer_restart bcm_rx_thr_handler(struct hrtimer *hrtimer)
                return HRTIMER_RESTART;
        } else {
                /* rearm throttle handling */
-               op->kt_lastmsg = ktime_set(0, 0);
+               op->kt_lastmsg = 0;
                return HRTIMER_NORESTART;
        }
 }
@@ -1196,7 +1196,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
                         * In any case cancel the throttle timer, flush
                         * potentially blocked msgs and reset throttle handling
                         */
-                       op->kt_lastmsg = ktime_set(0, 0);
+                       op->kt_lastmsg = 0;
                        hrtimer_cancel(&op->thrtimer);
                        bcm_rx_thr_flush(op, 1);
                }
index f9fd0957ab67f256d10e80563bb68ce88334f911..7c03fb0ea34cb8b5d46cb68779fa24d6dc276bc7 100644 (file)
@@ -80,11 +80,11 @@ void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
 
                if (skb->len > max_sifs_size)
                        hrtimer_start(&local->ifs_timer,
-                                     ktime_set(0, hw->phy->lifs_period * NSEC_PER_USEC),
+                                     hw->phy->lifs_period * NSEC_PER_USEC,
                                      HRTIMER_MODE_REL);
                else
                        hrtimer_start(&local->ifs_timer,
-                                     ktime_set(0, hw->phy->sifs_period * NSEC_PER_USEC),
+                                     hw->phy->sifs_period * NSEC_PER_USEC,
                                      HRTIMER_MODE_REL);
        } else {
                ieee802154_wake_queue(hw);
index 9ffe1c220b02848032474fa7b9b2c2f09d40b110..f1207582cbf3005f08af70275d6c1b217f60f26a 100644 (file)
@@ -509,7 +509,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)
        if (delay) {
                ktime_t time;
 
-               time = ktime_set(0, 0);
+               time = 0;
                time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay));
                hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS_PINNED);
        }
index ce54dce13ddb2cba959bca080b06f9285f2fe16d..a1652ab63918940be605eaf002b5506f5e4e6673 100644 (file)
@@ -72,7 +72,7 @@ static struct sctp_transport *sctp_transport_init(struct net *net,
         */
        peer->rto = msecs_to_jiffies(net->sctp.rto_initial);
 
-       peer->last_time_heard = ktime_set(0, 0);
+       peer->last_time_heard = 0;
        peer->last_time_ecne_reduced = jiffies;
 
        peer->param_flags = SPP_HB_DISABLE |
index d4ab9a7f3d94cf2d9073aad6f59f708e643f4974..64e3c82eedf6bbe0e6817d008fd661bdef8cca91 100644 (file)
@@ -1404,7 +1404,7 @@ int xfrm_state_check_expire(struct xfrm_state *x)
        if (x->curlft.bytes >= x->lft.hard_byte_limit ||
            x->curlft.packets >= x->lft.hard_packet_limit) {
                x->km.state = XFRM_STATE_EXPIRED;
-               tasklet_hrtimer_start(&x->mtimer, ktime_set(0, 0), HRTIMER_MODE_REL);
+               tasklet_hrtimer_start(&x->mtimer, 0, HRTIMER_MODE_REL);
                return -EINVAL;
        }
 
index 3689f5f6be6498b1aa19dfb72f6446987c591686..aca2d7d5f059568bfc485b906ac8a351f4f7159b 100644 (file)
@@ -166,7 +166,7 @@ static int pcsp_start_playing(struct snd_pcsp *chip)
        atomic_set(&chip->timer_active, 1);
        chip->thalf = 0;
 
-       hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL);
+       hrtimer_start(&pcsp_chip.timer, 0, HRTIMER_MODE_REL);
        return 0;
 }
 
index ca4dfcf4317579158c1cc6178a40fcf7eeda1052..7683238283b6c528e2eafa18f64a877fcbbe02c3 100644 (file)
@@ -114,7 +114,7 @@ static void async_midi_port_callback(struct fw_card *card, int rcode,
                snd_rawmidi_transmit_ack(substream, port->consume_bytes);
        else if (!rcode_is_permanent_error(rcode))
                /* To start next transaction immediately for recovery. */
-               port->next_ktime = ktime_set(0, 0);
+               port->next_ktime = 0;
        else
                /* Don't continue processing. */
                port->error = true;
@@ -156,7 +156,7 @@ static void midi_port_work(struct work_struct *work)
        if (port->consume_bytes <= 0) {
                /* Do it in next chance, immediately. */
                if (port->consume_bytes == 0) {
-                       port->next_ktime = ktime_set(0, 0);
+                       port->next_ktime = 0;
                        schedule_work(&port->work);
                } else {
                        /* Fatal error. */
@@ -219,7 +219,7 @@ int snd_fw_async_midi_port_init(struct snd_fw_async_midi_port *port,
        port->addr = addr;
        port->fill = fill;
        port->idling = true;
-       port->next_ktime = ktime_set(0, 0);
+       port->next_ktime = 0;
        port->error = false;
 
        INIT_WORK(&port->work, midi_port_work);
index abf9c0cab1e2b69ac8256cd14fae066d9cad7c8f..461b310c7872d98adc8e37b86d30a53e77fd1f8c 100644 (file)
@@ -87,7 +87,7 @@ static void dac_audio_reset(struct snd_sh_dac *chip)
 
 static void dac_audio_set_rate(struct snd_sh_dac *chip)
 {
-       chip->wakeups_per_second = ktime_set(0, 1000000000 / chip->rate);
+       chip->wakeups_per_second = 1000000000 / chip->rate;
 }