[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1273139497-25961-1-git-send-email-tklauser@distanz.ch>
Date: Thu, 6 May 2010 11:51:37 +0200
From: Tobias Klauser <tklauser@...tanz.ch>
To: benh@...nel.crashing.org
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Tobias Klauser <tklauser@...tanz.ch>
Subject: [PATCH] powerpc/BSR: 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@...tanz.ch>
---
drivers/char/bsr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 89d871e..aadc78b 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -210,7 +210,7 @@ static int bsr_add_node(struct device_node *bn)
cur->bsr_minor = i + total_bsr_devs;
cur->bsr_addr = res.start;
- cur->bsr_len = res.end - res.start + 1;
+ cur->bsr_len = resource_size(&res);
cur->bsr_bytes = bsr_bytes[i];
cur->bsr_stride = bsr_stride[i];
cur->bsr_dev = MKDEV(bsr_major, i + total_bsr_devs);
--
1.6.3.3
--
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