diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-12-25 12:30:41 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-12-25 17:21:22 +0100 |
commit | 8b0e195314fabd58a331c4f7b6db75a1565535d7 (patch) | |
tree | 6ff9d2d9388406b8447b09b6a4037795142172de /drivers/net | |
parent | ktime: Get rid of the union (diff) | |
download | linux-8b0e195314fabd58a331c4f7b6db75a1565535d7.tar.xz linux-8b0e195314fabd58a331c4f7b6db75a1565535d7.zip |
ktime: Cleanup ktime_set() usage
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/softing/softing_fw.c | 4 | ||||
-rw-r--r-- | drivers/net/can/softing/softing_main.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/ec_bhf.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/tile/tilegx.c | 4 | ||||
-rw-r--r-- | drivers/net/ieee802154/at86rf230.c | 9 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 4 |
8 files changed, 15 insertions, 17 deletions
diff --git a/drivers/net/can/softing/softing_fw.c b/drivers/net/can/softing/softing_fw.c index 52fe50725d74..4063215c9b54 100644 --- a/drivers/net/can/softing/softing_fw.c +++ b/drivers/net/can/softing/softing_fw.c @@ -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); diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c index 7621f91a8a20..5f64deec9f6c 100644 --- a/drivers/net/can/softing/softing_main.c +++ b/drivers/net/can/softing/softing_main.c @@ -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)); diff --git a/drivers/net/ethernet/ec_bhf.c b/drivers/net/ethernet/ec_bhf.c index 57650953ff83..7bf78a0d322c 100644 --- a/drivers/net/ethernet/ec_bhf.c +++ b/drivers/net/ethernet/ec_bhf.c @@ -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; diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index cda04b3126bc..4fe430ceb194 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -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); } diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c index 0aaf975bb347..2255f9a6f3bc 100644 --- a/drivers/net/ethernet/tile/tilegx.c +++ b/drivers/net/ethernet/tile/tilegx.c @@ -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; } diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 057025722e3d..46d53a6c8cf8 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -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; diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 2d1a6f2e16ab..f317984f7536 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -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); } diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c index 9f61293f1a56..f38c44061b5b 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c @@ -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); } |