aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwish.07@gmail.com>2007-05-09 05:35:34 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 15:30:57 -0400
commit50511da3da4d984fb944b2e373781b60915daf65 (patch)
tree17a3d4526fdd87ca20393cd7deef5270b5c19cf9
parentbc0ca06e24545117b69c94b1219dbe19392a0c5a (diff)
drivers/md.c: Use ARRAY_SIZE macro when appropriate
Use ARRAY_SIZE macro already defined in kernel.h Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/md/md.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2b4315d7e5d6..220e8e6fb7bb 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -33,6 +33,7 @@
33*/ 33*/
34 34
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/kernel.h>
36#include <linux/kthread.h> 37#include <linux/kthread.h>
37#include <linux/linkage.h> 38#include <linux/linkage.h>
38#include <linux/raid/md.h> 39#include <linux/raid/md.h>
@@ -2637,8 +2638,7 @@ metadata_store(mddev_t *mddev, const char *buf, size_t len)
2637 minor = simple_strtoul(buf, &e, 10); 2638 minor = simple_strtoul(buf, &e, 10);
2638 if (e==buf || (*e && *e != '\n') ) 2639 if (e==buf || (*e && *e != '\n') )
2639 return -EINVAL; 2640 return -EINVAL;
2640 if (major >= sizeof(super_types)/sizeof(super_types[0]) || 2641 if (major >= ARRAY_SIZE(super_types) || super_types[major].name == NULL)
2641 super_types[major].name == NULL)
2642 return -ENOENT; 2642 return -ENOENT;
2643 mddev->major_version = major; 2643 mddev->major_version = major;
2644 mddev->minor_version = minor; 2644 mddev->minor_version = minor;
@@ -4019,7 +4019,7 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info)
4019 if (info->raid_disks == 0) { 4019 if (info->raid_disks == 0) {
4020 /* just setting version number for superblock loading */ 4020 /* just setting version number for superblock loading */
4021 if (info->major_version < 0 || 4021 if (info->major_version < 0 ||
4022 info->major_version >= sizeof(super_types)/sizeof(super_types[0]) || 4022 info->major_version >= ARRAY_SIZE(super_types) ||
4023 super_types[info->major_version].name == NULL) { 4023 super_types[info->major_version].name == NULL) {
4024 /* maybe try to auto-load a module? */ 4024 /* maybe try to auto-load a module? */
4025 printk(KERN_INFO 4025 printk(KERN_INFO