Skip to contentSkip to conversation

trivial: use ARRAY_SIZE

PATCH Applied Kulikov Vasiliy 3 participants 3 messages Jun 28, 2010 – Jul 20, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/16 trivial: use ARRAY_SIZE

Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

---
 drivers/block/cciss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/cciss.c +1 -1
index 51ceaee..e1e7143 100644
@@ -335,7 +335,7 @@ static void cciss_map_sg_chain_block(ctlr_info_t *h, 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)
+#define RAID_UNKNOWN (ARRAY_SIZE(raid_label)-1)
 
 #ifdef CONFIG_PROC_FS
 
Signature · 1 line
1.7.0.4
Acked-by on v1 1/16
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: Kulikov Vasiliy [mailto:[email protected]]
Sent: Monday, June 28, 2010 6:55 AM
To: [email protected]
Cc: Kernel Janitors; Miller, Mike (OS Dev); Jens Axboe; Stephen M. Cameron; Andrew Morton; Patterson, Andrew D (LeftHand Networks); ISS StorageDev; [email protected]
Subject: [PATCH 01/16] trivial: use ARRAY_SIZE

Quoted 3 lines

Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

Quoted 23 lines
---
 drivers/block/cciss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/cciss.c +0 -0
index 51ceaee..e1e7143 100644
@@ -335,7 +335,7 @@ static void 

cciss_map_sg_chain_block(ctlr_info_t *h, CommandList_struct *c, static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG",

drivers/block/cciss.c +1 -2
 	"UNKNOWN"
 };
-#define RAID_UNKNOWN (sizeof(raid_label) / sizeof(raid_label[0])-1)
+#define RAID_UNKNOWN (ARRAY_SIZE(raid_label)-1)
 
 #ifdef CONFIG_PROC_FS
 
--

1.7.0.4