aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2009-09-17 14:48:15 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-10-01 15:15:44 -0400
commitfa52bec9df974096f9eb0e42a0b890512c0a0036 (patch)
tree0b9324d2dd8739f44e9ed9fb17fb17a7862c7cd3
parentce84a8aeac4a4a2cc421b3145dd2fb7cae860e4d (diff)
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>
-rw-r--r--drivers/block/cciss.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index ae0cb1329e92..b674f93d4be8 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -255,8 +255,6 @@ static inline void removeQ(CommandList_struct *c)
255 255
256#include "cciss_scsi.c" /* For SCSI tape support */ 256#include "cciss_scsi.c" /* For SCSI tape support */
257 257
258#define RAID_UNKNOWN 6
259
260#ifdef CONFIG_PROC_FS 258#ifdef CONFIG_PROC_FS
261 259
262/* 260/*
@@ -268,6 +266,7 @@ static inline void removeQ(CommandList_struct *c)
268static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG", 266static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG",
269 "UNKNOWN" 267 "UNKNOWN"
270}; 268};
269#define RAID_UNKNOWN (sizeof(raid_label) / sizeof(raid_label[0])-1)
271 270
272static struct proc_dir_entry *proc_cciss; 271static struct proc_dir_entry *proc_cciss;
273 272
@@ -341,7 +340,7 @@ static int cciss_seq_show(struct seq_file *seq, void *v)
341 vol_sz_frac *= 100; 340 vol_sz_frac *= 100;
342 sector_div(vol_sz_frac, ENG_GIG_FACTOR); 341 sector_div(vol_sz_frac, ENG_GIG_FACTOR);
343 342
344 if (drv->raid_level > 5) 343 if (drv->raid_level < 0 || drv->raid_level > RAID_UNKNOWN)
345 drv->raid_level = RAID_UNKNOWN; 344 drv->raid_level = RAID_UNKNOWN;
346 seq_printf(seq, "cciss/c%dd%d:" 345 seq_printf(seq, "cciss/c%dd%d:"
347 "\t%4u.%02uGB\tRAID %s\n", 346 "\t%4u.%02uGB\tRAID %s\n",