提交 9323b239 编写于 作者: B Benoit Taine 提交者: David S. Miller

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: NBenoit Taine <benoit.taine@lip6.fr>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 75348fc9
...@@ -1361,7 +1361,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) ...@@ -1361,7 +1361,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
__lpc_eth_clock_enable(pldat, true); __lpc_eth_clock_enable(pldat, true);
/* Map IO space */ /* 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) { if (!pldat->net_base) {
dev_err(&pdev->dev, "failed to map registers\n"); dev_err(&pdev->dev, "failed to map registers\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -1417,10 +1417,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) ...@@ -1417,10 +1417,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
} }
pldat->dma_buff_base_p = dma_handle; pldat->dma_buff_base_p = dma_handle;
netdev_dbg(ndev, "IO address start :0x%08x\n", netdev_dbg(ndev, "IO address space :%pR\n", res);
res->start); netdev_dbg(ndev, "IO address size :%d\n", resource_size(res));
netdev_dbg(ndev, "IO address size :%d\n",
res->end - res->start + 1);
netdev_dbg(ndev, "IO address (mapped) :0x%p\n", netdev_dbg(ndev, "IO address (mapped) :0x%p\n",
pldat->net_base); pldat->net_base);
netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq); netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册