xilinx: Use time_before_eq()
authorManuel Schölling <manuel.schoelling@gmx.de>
Thu, 22 May 2014 19:10:28 +0000 (21:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 May 2014 19:50:13 +0000 (15:50 -0400)
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: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/ll_temac_main.c
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c
drivers/net/ethernet/xilinx/xilinx_emaclite.c

index fa193c4688da78719257ac982af8be1f81b270c1..4ef818a7a6c623719f0507cfc64b56ef3de709d9 100644 (file)
@@ -75,7 +75,7 @@ int temac_indirect_busywait(struct temac_local *lp)
        long end = jiffies + 2;
 
        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);
                        return -ETIMEDOUT;
                }
index 64b4639f43b6bea6b0e69155a7cb7043a14abcc4..d4abf478e2bbf6ae25f5925f406d27923b2b949c 100644 (file)
@@ -22,7 +22,7 @@ int axienet_mdio_wait_until_ready(struct axienet_local *lp)
        long end = jiffies + 2;
        while (!(axienet_ior(lp, XAE_MDIO_MCR_OFFSET) &
                 XAE_MDIO_MCR_READY_MASK)) {
-               if (end - jiffies <= 0) {
+               if (time_before_eq(end, jiffies)) {
                        WARN_ON(1);
                        return -ETIMEDOUT;
                }
index 0d87c67a5ff7208e807a980c406a934214c9d4a6..8c4aed3053ebc0a3a3757dcae408f25249f8e630 100644 (file)
@@ -702,7 +702,7 @@ static int xemaclite_mdio_wait(struct net_local *lp)
        */
        while (__raw_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) &
                        XEL_MDIOCTRL_MDIOSTS_MASK) {
-               if (end - jiffies <= 0) {
+               if (time_before_eq(end, jiffies)) {
                        WARN_ON(1);
                        return -ETIMEDOUT;
                }