summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/nxp
diff options
context:
space:
mode:
authorBenoit Taine <benoit.taine@lip6.fr>2014-06-03 14:45:59 +0400
committerDavid S. Miller <davem@davemloft.net>2014-06-04 03:08:52 +0400
commit9323b239953605071866899e675c06fb2d41880c (patch)
treea5b1cf799077b30bb04cab22e4724561b0be04b9 /drivers/net/ethernet/nxp
parent75348fc915c1bf57b0382394d0b3298695bc9cf9 (diff)
downloadlinux-9323b239953605071866899e675c06fb2d41880c.tar.xz
lpc_eth: Use resource_size instead of computation
This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/resource_size.cocci Signed-off-by: Benoit Taine <benoit.taine@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/nxp')
-rw-r--r--drivers/net/ethernet/nxp/lpc_eth.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index 422d9b51ac24..8706c0dbd0c3 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1361,7 +1361,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
__lpc_eth_clock_enable(pldat, true);
/* Map IO space */
- pldat->net_base = ioremap(res->start, res->end - res->start + 1);
+ pldat->net_base = ioremap(res->start, resource_size(res));
if (!pldat->net_base) {
dev_err(&pdev->dev, "failed to map registers\n");
ret = -ENOMEM;
@@ -1417,10 +1417,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
}
pldat->dma_buff_base_p = dma_handle;
- netdev_dbg(ndev, "IO address start :0x%08x\n",
- res->start);
- netdev_dbg(ndev, "IO address size :%d\n",
- res->end - res->start + 1);
+ netdev_dbg(ndev, "IO address space :%pR\n", res);
+ netdev_dbg(ndev, "IO address size :%d\n", resource_size(res));
netdev_dbg(ndev, "IO address (mapped) :0x%p\n",
pldat->net_base);
netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq);