All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: bfin_sport_uart: Use resource size to fix off-by-one error
@ 2010-05-11  7:10 ` Tobias Klauser
  0 siblings, 0 replies; 4+ messages in thread
From: Tobias Klauser @ 2010-05-11  7:10 UTC (permalink / raw)
  To: vapier, gregkh, linux-serial; +Cc: kernel-janitors, Tobias Klauser

Use the resource_size function instead of manually calculating the
resource size. This actually fixes an off-by-one error.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/serial/bfin_sport_uart.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index 66cda22..e57fb3d 100644
--- a/drivers/serial/bfin_sport_uart.c
+++ b/drivers/serial/bfin_sport_uart.c
@@ -774,8 +774,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
 			goto out_error_free_peripherals;
 		}
 
-		sport->port.membase = ioremap(res->start,
-			res->end - res->start);
+		sport->port.membase = ioremap(res->start, resource_size(res));
 		if (!sport->port.membase) {
 			dev_err(&pdev->dev, "Cannot map sport IO\n");
 			ret = -ENXIO;
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] serial: bfin_sport_uart: Use resource size to fix off-by-one error
@ 2010-05-11  7:10 ` Tobias Klauser
  0 siblings, 0 replies; 4+ messages in thread
From: Tobias Klauser @ 2010-05-11  7:10 UTC (permalink / raw)
  To: vapier, gregkh, linux-serial; +Cc: kernel-janitors, Tobias Klauser

Use the resource_size function instead of manually calculating the
resource size. This actually fixes an off-by-one error.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/serial/bfin_sport_uart.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index 66cda22..e57fb3d 100644
--- a/drivers/serial/bfin_sport_uart.c
+++ b/drivers/serial/bfin_sport_uart.c
@@ -774,8 +774,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
 			goto out_error_free_peripherals;
 		}
 
-		sport->port.membase = ioremap(res->start,
-			res->end - res->start);
+		sport->port.membase = ioremap(res->start, resource_size(res));
 		if (!sport->port.membase) {
 			dev_err(&pdev->dev, "Cannot map sport IO\n");
 			ret = -ENXIO;
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] serial: bfin_sport_uart: Use resource size to fix
  2010-05-11  7:10 ` Tobias Klauser
@ 2010-05-11 18:08   ` Mike Frysinger
  -1 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2010-05-11 18:08 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: gregkh, linux-serial, kernel-janitors

On Tue, May 11, 2010 at 03:10, Tobias Klauser wrote:
> Use the resource_size function instead of manually calculating the
> resource size. This actually fixes an off-by-one error.

thanks !

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] serial: bfin_sport_uart: Use resource size to fix off-by-one error
@ 2010-05-11 18:08   ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2010-05-11 18:08 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: gregkh, linux-serial, kernel-janitors

On Tue, May 11, 2010 at 03:10, Tobias Klauser wrote:
> Use the resource_size function instead of manually calculating the
> resource size. This actually fixes an off-by-one error.

thanks !

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-11 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-11  7:10 [PATCH] serial: bfin_sport_uart: Use resource size to fix off-by-one error Tobias Klauser
2010-05-11  7:10 ` Tobias Klauser
2010-05-11 18:08 ` [PATCH] serial: bfin_sport_uart: Use resource size to fix Mike Frysinger
2010-05-11 18:08   ` [PATCH] serial: bfin_sport_uart: Use resource size to fix off-by-one error Mike Frysinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.