diff options
| author | Nicholas Mc Guire <hofrat@osadl.org> | 2015-06-07 06:35:46 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-06-08 02:45:39 -0400 |
| commit | cbab1510afbb140f7a51d996eafc525ac316c667 (patch) | |
| tree | 087be29b4b55dd5ebf602c63181d5cb6a0274337 /drivers/net/wan | |
| parent | fb79c066bce8620fae04112b33c55f279b60d3e1 (diff) | |
wan: dscc4: use msecs_to_jiffies for conversions
API compliance scanning with coccinelle flagged:
./drivers/net/wan/dscc4.c:1036:1-33:
WARNING: timeout (10) seems HZ dependent
./drivers/net/wan/dscc4.c:554:2-34:
WARNING: timeout (10) seems HZ dependent
./drivers/net/wan/dscc4.c:599:2-34:
WARNING: timeout (10) seems HZ dependent
Numeric constants passed to schedule_timeout_*() make the effective
timeout HZ dependent which does not seem to be the intent here.
Fixed up by converting the constant to jiffies with msecs_to_jiffies(),
passing 100ms (assuming HZ==100 in the original code).
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan')
| -rw-r--r-- | drivers/net/wan/dscc4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c index f76845de7aa8..7a72407208b1 100644 --- a/drivers/net/wan/dscc4.c +++ b/drivers/net/wan/dscc4.c | |||
| @@ -551,7 +551,7 @@ static int dscc4_wait_ack_cec(struct dscc4_dev_priv *dpriv, | |||
| 551 | msg, i); | 551 | msg, i); |
| 552 | goto done; | 552 | goto done; |
| 553 | } | 553 | } |
| 554 | schedule_timeout_uninterruptible(10); | 554 | schedule_timeout_uninterruptible(msecs_to_jiffies(100)); |
| 555 | rmb(); | 555 | rmb(); |
| 556 | } while (++i > 0); | 556 | } while (++i > 0); |
| 557 | netdev_err(dev, "%s timeout\n", msg); | 557 | netdev_err(dev, "%s timeout\n", msg); |
| @@ -596,7 +596,7 @@ static inline int dscc4_xpr_ack(struct dscc4_dev_priv *dpriv) | |||
| 596 | (dpriv->iqtx[cur] & cpu_to_le32(Xpr))) | 596 | (dpriv->iqtx[cur] & cpu_to_le32(Xpr))) |
| 597 | break; | 597 | break; |
| 598 | smp_rmb(); | 598 | smp_rmb(); |
| 599 | schedule_timeout_uninterruptible(10); | 599 | schedule_timeout_uninterruptible(msecs_to_jiffies(100)); |
| 600 | } while (++i > 0); | 600 | } while (++i > 0); |
| 601 | 601 | ||
| 602 | return (i >= 0 ) ? i : -EAGAIN; | 602 | return (i >= 0 ) ? i : -EAGAIN; |
| @@ -1033,7 +1033,7 @@ static void dscc4_pci_reset(struct pci_dev *pdev, void __iomem *ioaddr) | |||
| 1033 | /* Flush posted writes */ | 1033 | /* Flush posted writes */ |
| 1034 | readl(ioaddr + GSTAR); | 1034 | readl(ioaddr + GSTAR); |
| 1035 | 1035 | ||
| 1036 | schedule_timeout_uninterruptible(10); | 1036 | schedule_timeout_uninterruptible(msecs_to_jiffies(100)); |
| 1037 | 1037 | ||
| 1038 | for (i = 0; i < 16; i++) | 1038 | for (i = 0; i < 16; i++) |
| 1039 | pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]); | 1039 | pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]); |
