lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <BD79186B4FD85F4B8E60E381CAEE190901FB0FCE@mi8nycmail19.Mi8.com>
Date:	Thu, 10 Dec 2009 20:51:37 -0500
From:	"H Hartley Sweeten" <hartleys@...ionengravers.com>
To:	"kernel list" <linux-kernel@...r.kernel.org>
Cc:	<zw@...kernel.org>, <leoli@...escale.com>
Subject: [PATCH] fsldma.c: use resource_size()

Use resource_size() for ioremap.

Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
Cc: Zhang Wei <zw@...kernel.org>
Cc: Li Yang <leoli@...escale.com>

---

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 296f9e7..ca20a9c 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1095,7 +1095,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
 
 	new_fsl_chan->dev = fdev->dev;
 	new_fsl_chan->reg_base = ioremap(new_fsl_chan->reg.start,
-			new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1);
+					 resource_size(&new_fsl_chan->reg));
 
 	new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7;
 	if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) {
@@ -1196,8 +1196,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
 	dev_info(&dev->dev, "Probe the Freescale DMA driver for %s "
 			"controller at 0x%llx...\n",
 			match->compatible, (unsigned long long)fdev->reg.start);
-	fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end
-						- fdev->reg.start + 1);
+	fdev->reg_base = ioremap(fdev->reg.start, resource_size(&fdev->reg));
 
 	dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
 	dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ