diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2010-03-11 17:08:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-19 10:17:56 -0400 |
commit | 231443665882a02214c3748b9f86615a3ce9e5c2 (patch) | |
tree | 46063b96172dc6579fdae2e774ceaff8027d22cb | |
parent | d4bee0a677cfa5a32f964ffa420e27406c65e605 (diff) |
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>
-rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_cpm2.c | 4 |
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 a9802e76b5fa..722eac18f382 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, | |||
61 | void __iomem *pram; | 61 | void __iomem *pram; |
62 | unsigned long offset; | 62 | unsigned long offset; |
63 | struct resource res; | 63 | struct resource res; |
64 | unsigned long len; | 64 | resource_size_t len; |
65 | 65 | ||
66 | /* Don't remap parameter RAM if it has already been initialized | 66 | /* Don't remap parameter RAM if it has already been initialized |
67 | * during console setup. | 67 | * during console setup. |
@@ -74,7 +74,7 @@ void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port, | |||
74 | if (of_address_to_resource(np, 1, &res)) | 74 | if (of_address_to_resource(np, 1, &res)) |
75 | return NULL; | 75 | return NULL; |
76 | 76 | ||
77 | len = 1 + res.end - res.start; | 77 | len = resource_size(&res); |
78 | pram = ioremap(res.start, len); | 78 | pram = ioremap(res.start, len); |
79 | if (!pram) | 79 | if (!pram) |
80 | return NULL; | 80 | return NULL; |