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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <BD79186B4FD85F4B8E60E381CAEE19090200EA93@mi8nycmail19.Mi8.com>
Date:	Mon, 14 Dec 2009 17:48:59 -0500
From:	"H Hartley Sweeten" <hartleys@...ionengravers.com>
To:	"kernel list" <linux-kernel@...r.kernel.org>,
	<spi-devel-general@...ts.sourceforge.net>
Cc:	"David Brownell" <dbrownell@...rs.sourceforge.net>
Subject: [PATCH] xilinx_spi.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
Cc: David Brownell <dbrownell@...rs.sourceforge.net>

---

diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 5a143b9..32525e6 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -332,14 +332,14 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev,
 
 	xspi->irq = r_irq->start;
 
-	if (!request_mem_region(r_mem->start,
-			r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) {
+	if (!request_mem_region(r_mem->start, resource_size(r_mem),
+			XILINX_SPI_NAME)) {
 		rc = -ENXIO;
 		dev_warn(&ofdev->dev, "memory request failure\n");
 		goto put_master;
 	}
 
-	xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1);
+	xspi->regs = ioremap(r_mem->start, resource_size(r_mem));
 	if (xspi->regs == NULL) {
 		rc = -ENOMEM;
 		dev_warn(&ofdev->dev, "ioremap failure\n"); 
--
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