From: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, stigge@antcom.de, edumazet@google.com,
gregkh@linuxfoundation.org, jiri@resnulli.us,
linux-kernel@vger.kernel.org,
Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Subject: [PATCH] ethernet: nxp: use resource_size()
Date: Tue, 12 Mar 2013 20:30:35 +0200 [thread overview]
Message-ID: <1363113035-11269-1-git-send-email-silviupopescu1990@gmail.com> (raw)
Use resource_size() instead of explicit calculation. This was found via
make coccicheck.
Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
drivers/net/ethernet/nxp/lpc_eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index c4122c8..bc493c8 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1362,7 +1362,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;
@@ -1421,7 +1421,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
netdev_dbg(ndev, "IO address start :0x%08x\n",
res->start);
netdev_dbg(ndev, "IO address size :%d\n",
- res->end - res->start + 1);
+ resource_size(res));
netdev_dbg(ndev, "IO address (mapped) :0x%p\n",
pldat->net_base);
netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq);
--
1.7.9.5
next reply other threads:[~2013-03-12 18:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 18:30 Silviu-Mihai Popescu [this message]
2013-03-12 19:10 ` [PATCH] ethernet: nxp: use resource_size() Joe Perches
2013-03-12 22:35 ` Silviu Popescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1363113035-11269-1-git-send-email-silviupopescu1990@gmail.com \
--to=silviupopescu1990@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jiri@resnulli.us \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stigge@antcom.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox