diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2006-01-08 01:05:11 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 20:14:08 -0800 |
commit | 945f390f02ce44a13aefc6d9449c99f33c9286a5 (patch) | |
tree | be5685ed17677b4c076b69e7d4d77eae4cbe718c /drivers/block/xd.c | |
parent | ef9ceab28203690a42d7d3915ccf6e208f0762bc (diff) | |
download | linux-3.10-945f390f02ce44a13aefc6d9449c99f33c9286a5.tar.gz linux-3.10-945f390f02ce44a13aefc6d9449c99f33c9286a5.tar.bz2 linux-3.10-945f390f02ce44a13aefc6d9449c99f33c9286a5.zip |
[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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/xd.c b/drivers/block/xd.c index 97f5dab24b5..cbce7c5e944 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) return(1); } - for (i = 0; i < (sizeof(xd_bases) / sizeof(xd_bases[0])); i++) { + for (i = 0; i < ARRAY_SIZE(xd_bases); i++) { void __iomem *p = ioremap(xd_bases[i], 0x2000); if (!p) continue; - for (j = 1; j < (sizeof(xd_sigs) / sizeof(xd_sigs[0])); j++) { + for (j = 1; j < ARRAY_SIZE(xd_sigs); j++) { const char *s = xd_sigs[j].string; if (check_signature(p + xd_sigs[j].offset, s, strlen(s))) { *controller = j; @@ -1018,7 +1018,7 @@ static void __init do_xd_setup (int *integers) case 2: if ((integers[2] > 0) && (integers[2] < 16)) xd_irq = integers[2]; case 1: xd_override = 1; - if ((integers[1] >= 0) && (integers[1] < (sizeof(xd_sigs) / sizeof(xd_sigs[0])))) + if ((integers[1] >= 0) && (integers[1] < ARRAY_SIZE(xd_sigs))) xd_type = integers[1]; case 0: break; default:printk("xd: too many parameters for xd\n"); |