net: fec: avoid BD pointer type cast to 32bit
authorFugang Duan <fugang.duan@nxp.com>
Tue, 11 Apr 2017 11:13:04 +0000 (19:13 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Apr 2017 18:36:27 +0000 (14:36 -0400)
In aarch64 system, the BD pointer is 64bit, and the high-order 32-bits
of the address is effective, so replace usigned with (void *) type to
aovid 64bit address is casted to 32bit in .fec_enet_get_nextdesc() and
.fec_enet_get_prevdesc() functions.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 886a9c9fd6283e85734cc5ce41586aa2f4871ecf..172624c2d5be894b6e6cf82d8a86a50696238bb8 100644 (file)
@@ -235,14 +235,14 @@ static struct bufdesc *fec_enet_get_nextdesc(struct bufdesc *bdp,
                                             struct bufdesc_prop *bd)
 {
        return (bdp >= bd->last) ? bd->base
-                       : (struct bufdesc *)(((unsigned)bdp) + bd->dsize);
+                       : (struct bufdesc *)(((void *)bdp) + bd->dsize);
 }
 
 static struct bufdesc *fec_enet_get_prevdesc(struct bufdesc *bdp,
                                             struct bufdesc_prop *bd)
 {
        return (bdp <= bd->base) ? bd->last
-                       : (struct bufdesc *)(((unsigned)bdp) - bd->dsize);
+                       : (struct bufdesc *)(((void *)bdp) - bd->dsize);
 }
 
 static int fec_enet_get_bd_index(struct bufdesc *bdp,