linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ag71xx: use resource_size for the ioremap size
@ 2019-07-29  9:01 Ding Xiang
  2019-07-29 16:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ding Xiang @ 2019-07-29  9:01 UTC (permalink / raw)
  To: jcliburn, chris.snook, davem; +Cc: netdev, linux-kernel

use resource_size to calcuate ioremap size and make
the code simpler.

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
---
 drivers/net/ethernet/atheros/ag71xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index 8b69d0d..77542bd 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -1686,7 +1686,7 @@ static int ag71xx_probe(struct platform_device *pdev)
 	}
 
 	ag->mac_base = devm_ioremap_nocache(&pdev->dev, res->start,
-					    res->end - res->start + 1);
+					    resource_size(res));
 	if (!ag->mac_base) {
 		err = -ENOMEM;
 		goto err_free;
-- 
1.9.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: ag71xx: use resource_size for the ioremap size
  2019-07-29  9:01 [PATCH] net: ag71xx: use resource_size for the ioremap size Ding Xiang
@ 2019-07-29 16:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-07-29 16:48 UTC (permalink / raw)
  To: dingxiang; +Cc: jcliburn, chris.snook, netdev, linux-kernel

From: Ding Xiang <dingxiang@cmss.chinamobile.com>
Date: Mon, 29 Jul 2019 17:01:22 +0800

> use resource_size to calcuate ioremap size and make
> the code simpler.
> 
> Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>

Applied to net-next.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-29 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29  9:01 [PATCH] net: ag71xx: use resource_size for the ioremap size Ding Xiang
2019-07-29 16:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).