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>
This commit is contained in:
Tobias Klauser 2010-03-11 14:08:18 -08:00 committed by Greg Kroah-Hartman
parent d4bee0a677
commit 2314436658
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
void __iomem *pram; void __iomem *pram;
unsigned long offset; unsigned long offset;
struct resource res; struct resource res;
unsigned long len; resource_size_t len;
/* Don't remap parameter RAM if it has already been initialized /* Don't remap parameter RAM if it has already been initialized
* during console setup. * 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)) if (of_address_to_resource(np, 1, &res))
return NULL; return NULL;
len = 1 + res.end - res.start; len = resource_size(&res);
pram = ioremap(res.start, len); pram = ioremap(res.start, len);
if (!pram) if (!pram)
return NULL; return NULL;