net: fs_enet: Fix incorrect IS_ERR_VALUE macro usages
Subsystems (3)
PATCH 1/1 net: fs_enet: Fix incorrect IS_ERR_VALUE macro usages
IS_ERR_VALUE macro should be used only with unsigned long type. Especially it works incorrectly with unsigned shorter types on 64bit machines.
Fixes 976de6a8c304 ("fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.")
Fixes 4c35630ccda5 ("[POWERPC] Change rheap functions to use ulongs instead of pointers")
Signed-off-by Wei Li <[email protected]>
--- drivers/net/ethernet/freescale/fs_enet/mac-fcc.c | 2 +- drivers/net/ethernet/freescale/fs_enet/mac-scc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c +1 -1
@@ -107,7 +107,7 @@ static int do_pd_setup(struct fs_enet_private *fep) fep->fcc.mem = (void __iomem *)cpm2_immr; fpi->dpram_offset =cpm_dpalloc (128 ,32 ); -if (IS_ERR_VALUE (fpi->dpram_offset)) { +if (IS_ERR_VALUE ((unsigned long )(int )fpi->dpram_offset)) { ret = fpi->dpram_offset; goto out_fcccp; }
drivers/net/ethernet/freescale/fs_enet/mac-scc.c +1 -1
@@ -136,7 +136,7 @@ static int allocate_bd(struct net_device *dev) fep->ring_mem_addr =cpm_dpalloc ((fpi->tx_ring + fpi->rx_ring) *sizeof (cbd_t),8 ); -if (IS_ERR_VALUE (fep->ring_mem_addr)) +if (IS_ERR_VALUE ((unsigned long )(int )fep->ring_mem_addr))return -ENOMEM ; fep->ring_base = (void __iomem __force*)
Signature · 1 line
2.17.1