diff options
author | Bjørn Mork <bjorn@mork.no> | 2014-05-19 03:21:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-21 01:56:06 -0400 |
commit | 7d10d2610cc02d432168ca0c5d964cd9e85c1b06 (patch) | |
tree | 98f8c2cf6654dd4d1d5d5052fb2da213e243a914 /drivers/net/usb | |
parent | b6052af61a9e0dee236bcf4c69843126c0d28e4f (diff) |
net: cdc_ncm: fix 64bit division build error
The upper timer_interval limit is arbitrary and much higher
than anything usable in the real world. Reducing it from 15s
to ~4s to make the timer_interval fit in an u32 does not make
much difference. The limit is still outside the practical
bounds.
This eliminates the need for a 64bit timer_interval, fixing a
build error related to 64bit division:
drivers/built-in.o: In function `cdc_ncm_get_coalesce':
ak8975.c:(.text+0x1ac994): undefined reference to `__aeabi_uldivmod'
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 2d0caf1eea25..ad2a386a6e92 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -138,7 +138,7 @@ static int cdc_ncm_get_coalesce(struct net_device *netdev, | |||
138 | ec->tx_max_coalesced_frames = ctx->tx_max / ctx->max_datagram_size; | 138 | ec->tx_max_coalesced_frames = ctx->tx_max / ctx->max_datagram_size; |
139 | 139 | ||
140 | /* the timer will fire CDC_NCM_TIMER_PENDING_CNT times in a row */ | 140 | /* the timer will fire CDC_NCM_TIMER_PENDING_CNT times in a row */ |
141 | ec->tx_coalesce_usecs = (ctx->timer_interval * CDC_NCM_TIMER_PENDING_CNT) / NSEC_PER_USEC; | 141 | ec->tx_coalesce_usecs = ctx->timer_interval / (NSEC_PER_USEC / CDC_NCM_TIMER_PENDING_CNT); |
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | 144 | ||
@@ -164,7 +164,7 @@ static int cdc_ncm_set_coalesce(struct net_device *netdev, | |||
164 | return -EINVAL; | 164 | return -EINVAL; |
165 | 165 | ||
166 | spin_lock_bh(&ctx->mtx); | 166 | spin_lock_bh(&ctx->mtx); |
167 | ctx->timer_interval = ec->tx_coalesce_usecs * NSEC_PER_USEC / CDC_NCM_TIMER_PENDING_CNT; | 167 | ctx->timer_interval = ec->tx_coalesce_usecs * (NSEC_PER_USEC / CDC_NCM_TIMER_PENDING_CNT); |
168 | if (!ctx->timer_interval) | 168 | if (!ctx->timer_interval) |
169 | ctx->tx_timer_pending = 0; | 169 | ctx->tx_timer_pending = 0; |
170 | spin_unlock_bh(&ctx->mtx); | 170 | spin_unlock_bh(&ctx->mtx); |