diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2006-06-09 01:23:48 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-10 11:45:30 -0400 |
commit | 6391a11375de5e2bb1eb8481e54619761dc65d9f (patch) | |
tree | 956aae1d278a3f731b2e6148ff40a69aa7957ea8 /drivers/scsi/wd7000.c | |
parent | 9dc399de0840a478adb71278becf598d3ab3aacc (diff) |
[SCSI] drivers/scsi: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
duplicates of the macro.
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/wd7000.c')
-rw-r--r-- | drivers/scsi/wd7000.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index fb54a87a80a3..e55f0ee7e7e4 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c | |||
@@ -267,7 +267,7 @@ static const long wd7000_biosaddr[] = { | |||
267 | 0xc0000, 0xc2000, 0xc4000, 0xc6000, 0xc8000, 0xca000, 0xcc000, 0xce000, | 267 | 0xc0000, 0xc2000, 0xc4000, 0xc6000, 0xc8000, 0xca000, 0xcc000, 0xce000, |
268 | 0xd0000, 0xd2000, 0xd4000, 0xd6000, 0xd8000, 0xda000, 0xdc000, 0xde000 | 268 | 0xd0000, 0xd2000, 0xd4000, 0xd6000, 0xd8000, 0xda000, 0xdc000, 0xde000 |
269 | }; | 269 | }; |
270 | #define NUM_ADDRS (sizeof(wd7000_biosaddr)/sizeof(long)) | 270 | #define NUM_ADDRS ARRAY_SIZE(wd7000_biosaddr) |
271 | 271 | ||
272 | static const unsigned short wd7000_iobase[] = { | 272 | static const unsigned short wd7000_iobase[] = { |
273 | 0x0300, 0x0308, 0x0310, 0x0318, 0x0320, 0x0328, 0x0330, 0x0338, | 273 | 0x0300, 0x0308, 0x0310, 0x0318, 0x0320, 0x0328, 0x0330, 0x0338, |
@@ -275,13 +275,13 @@ static const unsigned short wd7000_iobase[] = { | |||
275 | 0x0380, 0x0388, 0x0390, 0x0398, 0x03a0, 0x03a8, 0x03b0, 0x03b8, | 275 | 0x0380, 0x0388, 0x0390, 0x0398, 0x03a0, 0x03a8, 0x03b0, 0x03b8, |
276 | 0x03c0, 0x03c8, 0x03d0, 0x03d8, 0x03e0, 0x03e8, 0x03f0, 0x03f8 | 276 | 0x03c0, 0x03c8, 0x03d0, 0x03d8, 0x03e0, 0x03e8, 0x03f0, 0x03f8 |
277 | }; | 277 | }; |
278 | #define NUM_IOPORTS (sizeof(wd7000_iobase)/sizeof(unsigned short)) | 278 | #define NUM_IOPORTS ARRAY_SIZE(wd7000_iobase) |
279 | 279 | ||
280 | static const short wd7000_irq[] = { 3, 4, 5, 7, 9, 10, 11, 12, 14, 15 }; | 280 | static const short wd7000_irq[] = { 3, 4, 5, 7, 9, 10, 11, 12, 14, 15 }; |
281 | #define NUM_IRQS (sizeof(wd7000_irq)/sizeof(short)) | 281 | #define NUM_IRQS ARRAY_SIZE(wd7000_irq) |
282 | 282 | ||
283 | static const short wd7000_dma[] = { 5, 6, 7 }; | 283 | static const short wd7000_dma[] = { 5, 6, 7 }; |
284 | #define NUM_DMAS (sizeof(wd7000_dma)/sizeof(short)) | 284 | #define NUM_DMAS ARRAY_SIZE(wd7000_dma) |
285 | 285 | ||
286 | /* | 286 | /* |
287 | * The following is set up by wd7000_detect, and used thereafter for | 287 | * The following is set up by wd7000_detect, and used thereafter for |
@@ -317,7 +317,7 @@ static Config configs[] = { | |||
317 | {7, 6, 0x350, BUS_ON, BUS_OFF}, /* My configuration (Zaga) */ | 317 | {7, 6, 0x350, BUS_ON, BUS_OFF}, /* My configuration (Zaga) */ |
318 | {-1, -1, 0x0, BUS_ON, BUS_OFF} /* Empty slot */ | 318 | {-1, -1, 0x0, BUS_ON, BUS_OFF} /* Empty slot */ |
319 | }; | 319 | }; |
320 | #define NUM_CONFIGS (sizeof(configs)/sizeof(Config)) | 320 | #define NUM_CONFIGS ARRAY_SIZE(configs) |
321 | 321 | ||
322 | /* | 322 | /* |
323 | * The following list defines strings to look for in the BIOS that identify | 323 | * The following list defines strings to look for in the BIOS that identify |
@@ -333,7 +333,7 @@ typedef struct signature { | |||
333 | static const Signature signatures[] = { | 333 | static const Signature signatures[] = { |
334 | {"SSTBIOS", 0x0000d, 7} /* "SSTBIOS" @ offset 0x0000d */ | 334 | {"SSTBIOS", 0x0000d, 7} /* "SSTBIOS" @ offset 0x0000d */ |
335 | }; | 335 | }; |
336 | #define NUM_SIGNATURES (sizeof(signatures)/sizeof(Signature)) | 336 | #define NUM_SIGNATURES ARRAY_SIZE(signatures) |
337 | 337 | ||
338 | 338 | ||
339 | /* | 339 | /* |