Commit 3aeea53f authored by Manuel Schölling's avatar Manuel Schölling Committed by David S. Miller

xilinx: Use time_before_eq()

To be future-proof and for better readability the time comparisons are modified
to use time_before_eq() instead of plain, error-prone math.
Signed-off-by: default avatarManuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 05e1e76e
...@@ -75,7 +75,7 @@ int temac_indirect_busywait(struct temac_local *lp) ...@@ -75,7 +75,7 @@ int temac_indirect_busywait(struct temac_local *lp)
long end = jiffies + 2; long end = jiffies + 2;
while (!(temac_ior(lp, XTE_RDY0_OFFSET) & XTE_RDY0_HARD_ACS_RDY_MASK)) { while (!(temac_ior(lp, XTE_RDY0_OFFSET) & XTE_RDY0_HARD_ACS_RDY_MASK)) {
if (end - jiffies <= 0) { if (time_before_eq(end, jiffies)) {
WARN_ON(1); WARN_ON(1);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
...@@ -22,7 +22,7 @@ int axienet_mdio_wait_until_ready(struct axienet_local *lp) ...@@ -22,7 +22,7 @@ int axienet_mdio_wait_until_ready(struct axienet_local *lp)
long end = jiffies + 2; long end = jiffies + 2;
while (!(axienet_ior(lp, XAE_MDIO_MCR_OFFSET) & while (!(axienet_ior(lp, XAE_MDIO_MCR_OFFSET) &
XAE_MDIO_MCR_READY_MASK)) { XAE_MDIO_MCR_READY_MASK)) {
if (end - jiffies <= 0) { if (time_before_eq(end, jiffies)) {
WARN_ON(1); WARN_ON(1);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
...@@ -702,7 +702,7 @@ static int xemaclite_mdio_wait(struct net_local *lp) ...@@ -702,7 +702,7 @@ static int xemaclite_mdio_wait(struct net_local *lp)
*/ */
while (__raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) & while (__raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) &
XEL_MDIOCTRL_MDIOSTS_MASK) { XEL_MDIOCTRL_MDIOSTS_MASK) {
if (end - jiffies <= 0) { if (time_before_eq(end, jiffies)) {
WARN_ON(1); WARN_ON(1);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment