diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2009-09-17 13:48:15 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-10-01 21:15:44 +0200 |
commit | fa52bec9df974096f9eb0e42a0b890512c0a0036 (patch) | |
tree | 0b9324d2dd8739f44e9ed9fb17fb17a7862c7cd3 /drivers/block/cciss.c | |
parent | ce84a8aeac4a4a2cc421b3145dd2fb7cae860e4d (diff) | |
download | op-kernel-dev-fa52bec9df974096f9eb0e42a0b890512c0a0036.zip op-kernel-dev-fa52bec9df974096f9eb0e42a0b890512c0a0036.tar.gz |
cciss: fix some magic numbers in the raid-level decoding
cciss: fix some magic numbers in the raid-level decoding
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index ae0cb13..b674f93 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -255,8 +255,6 @@ static inline void removeQ(CommandList_struct *c) #include "cciss_scsi.c" /* For SCSI tape support */ -#define RAID_UNKNOWN 6 - #ifdef CONFIG_PROC_FS /* @@ -268,6 +266,7 @@ static inline void removeQ(CommandList_struct *c) static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG", "UNKNOWN" }; +#define RAID_UNKNOWN (sizeof(raid_label) / sizeof(raid_label[0])-1) static struct proc_dir_entry *proc_cciss; @@ -341,7 +340,7 @@ static int cciss_seq_show(struct seq_file *seq, void *v) vol_sz_frac *= 100; sector_div(vol_sz_frac, ENG_GIG_FACTOR); - if (drv->raid_level > 5) + if (drv->raid_level < 0 || drv->raid_level > RAID_UNKNOWN) drv->raid_level = RAID_UNKNOWN; seq_printf(seq, "cciss/c%dd%d:" "\t%4u.%02uGB\tRAID %s\n", |