summaryrefslogtreecommitdiffstats
path: root/drivers/serial/cpm_uart
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2010-03-11 14:08:18 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-19 07:17:56 -0700
commit231443665882a02214c3748b9f86615a3ce9e5c2 (patch)
tree46063b96172dc6579fdae2e774ceaff8027d22cb /drivers/serial/cpm_uart
parentd4bee0a677cfa5a32f964ffa420e27406c65e605 (diff)
downloadop-kernel-dev-231443665882a02214c3748b9f86615a3ce9e5c2.zip
op-kernel-dev-231443665882a02214c3748b9f86615a3ce9e5c2.tar.gz
tty: cpm_uart: use resource_size()
Use the resource_size function instead of manually calculating the resource size. This reduces the chance of introducing off-by-one errors. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Kumar Gala <galak@gate.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/cpm_uart')
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index a9802e7..722eac1 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -61,7 +61,7 @@ void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
void __iomem *pram;
unsigned long offset;
struct resource res;
- unsigned long len;
+ resource_size_t len;
/* Don't remap parameter RAM if it has already been initialized
* during console setup.
@@ -74,7 +74,7 @@ void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
if (of_address_to_resource(np, 1, &res))
return NULL;
- len = 1 + res.end - res.start;
+ len = resource_size(&res);
pram = ioremap(res.start, len);
if (!pram)
return NULL;
OpenPOWER on IntegriCloud