* [PATCH] atm: use msecs_to_jiffies for conversions
@ 2015-06-08 19:16 Nicholas Mc Guire
2015-06-08 22:54 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-06-08 19:16 UTC (permalink / raw)
To: Chas Williams; +Cc: linux-atm-general, netdev, linux-kernel, Nicholas Mc Guire
API compliance scanning with coccinelle flagged:
./drivers/atm/iphase.c:2621:4-20:
WARNING: timeout (50) seems HZ dependent
Numeric constants passed to schedule_timeout() make the effective
timeout HZ dependent which does not seem intended.
Fixed up by converting the constant to jiffies with msecs_to_jiffies()
As this driver was introduced in the early 2.3 series it is most
likely assuming HZ=100 so the constant 50 is converted to 500ms.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
Patch was compile tested with i386_defconfig + CONFIG_ATM=y,
CONFIG_ATM_IA=m
Patch is against 4.1-rc6 (localversion-next is -next-20150605)
drivers/atm/iphase.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 924f8e2..65e6590 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -2618,7 +2618,7 @@ static void ia_close(struct atm_vcc *vcc)
if (vcc->qos.txtp.traffic_class != ATM_NONE) {
iadev->close_pending++;
prepare_to_wait(&iadev->timeout_wait, &wait, TASK_UNINTERRUPTIBLE);
- schedule_timeout(50);
+ schedule_timeout(msecs_to_jiffies(500));
finish_wait(&iadev->timeout_wait, &wait);
spin_lock_irqsave(&iadev->tx_lock, flags);
while((skb = skb_dequeue(&iadev->tx_backlog))) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] atm: use msecs_to_jiffies for conversions
2015-06-08 19:16 [PATCH] atm: use msecs_to_jiffies for conversions Nicholas Mc Guire
@ 2015-06-08 22:54 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-06-08 22:54 UTC (permalink / raw)
To: hofrat; +Cc: 3chas3, linux-atm-general, netdev, linux-kernel
From: Nicholas Mc Guire <hofrat@osadl.org>
Date: Mon, 8 Jun 2015 21:16:28 +0200
> API compliance scanning with coccinelle flagged:
> ./drivers/atm/iphase.c:2621:4-20:
> WARNING: timeout (50) seems HZ dependent
>
> Numeric constants passed to schedule_timeout() make the effective
> timeout HZ dependent which does not seem intended.
> Fixed up by converting the constant to jiffies with msecs_to_jiffies()
> As this driver was introduced in the early 2.3 series it is most
> likely assuming HZ=100 so the constant 50 is converted to 500ms.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-08 22:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-08 19:16 [PATCH] atm: use msecs_to_jiffies for conversions Nicholas Mc Guire
2015-06-08 22:54 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).