aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xd.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2006-01-08 04:05:11 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 23:14:08 -0500
commit945f390f02ce44a13aefc6d9449c99f33c9286a5 (patch)
treebe5685ed17677b4c076b69e7d4d77eae4cbe718c /drivers/block/xd.c
parentef9ceab28203690a42d7d3915ccf6e208f0762bc (diff)
[PATCH] drivers/block: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a duplicate of ARRAY_SIZE. Some trailing whitespaces are also removed. drivers/block/acsi* has been left out as it's marked BROKEN. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Cc: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/xd.c')
-rw-r--r--drivers/block/xd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 97f5dab24b5a..cbce7c5e9445 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -279,11 +279,11 @@ static u_char __init xd_detect (u_char *controller, unsigned int *address)
279 return(1); 279 return(1);
280 } 280 }
281 281
282 for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])); i++) { 282 for (i = 0; i < ARRAY_SIZE(xd_bases); i++) {
283 void __iomem *p = ioremap(xd_bases[i], 0x2000); 283 void __iomem *p = ioremap(xd_bases[i], 0x2000);
284 if (!p) 284 if (!p)
285 continue; 285 continue;
286 for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])); j++) { 286 for (j = 1; j < ARRAY_SIZE(xd_sigs); j++) {
287 const char *s = xd_sigs[j].string; 287 const char *s = xd_sigs[j].string;
288 if (check_signature(p + xd_sigs[j].offset, s, strlen(s))) { 288 if (check_signature(p + xd_sigs[j].offset, s, strlen(s))) {
289 *controller = j; 289 *controller = j;
@@ -1018,7 +1018,7 @@ static void __init do_xd_setup (int *integers)
1018 case 2: if ((integers[2] > 0) && (integers[2] < 16)) 1018 case 2: if ((integers[2] > 0) && (integers[2] < 16))
1019 xd_irq = integers[2]; 1019 xd_irq = integers[2];
1020 case 1: xd_override = 1; 1020 case 1: xd_override = 1;
1021 if ((integers[1] >= 0) && (integers[1] < (sizeof(xd_sigs) / sizeof(xd_sigs[0])))) 1021 if ((integers[1] >= 0) && (integers[1] < ARRAY_SIZE(xd_sigs)))
1022 xd_type = integers[1]; 1022 xd_type = integers[1];
1023 case 0: break; 1023 case 0: break;
1024 default:printk("xd: too many parameters for xd\n"); 1024 default:printk("xd: too many parameters for xd\n");