summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2006-06-25 05:49:03 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 10:01:21 -0700
commit5e8621e8bdc2460da516d5f1a5c71d3467ded5d2 (patch)
tree90557f32a4df3364cb6ff189f8e75c7d4338fc47 /drivers/block
parent40aabb5815723551e7c92dd08ed3ea82ec000ccd (diff)
[PATCH] CCISS: use ARRAY_SIZE without intermediates
It's easier to verify loop bounds if the array name is mentioned the for() statement that steps through the array. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-by: Jeff Garzik <jeff@garzik.org> Acked-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/cciss.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index f7c3c53bd0c..94e82a229d9 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -104,8 +104,6 @@ static const struct pci_device_id cciss_pci_device_id[] = {
};
MODULE_DEVICE_TABLE(pci, cciss_pci_device_id);
-#define NR_PRODUCTS ARRAY_SIZE(products)
-
/* board_id = Subsystem Device ID & Vendor ID
* product = Marketing Name for the board
* access = Address of the struct of function pointers
@@ -2831,14 +2829,14 @@ static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
print_cfg_table(c->cfgtable);
#endif /* CCISS_DEBUG */
- for(i=0; i<NR_PRODUCTS; i++) {
+ for(i=0; i<ARRAY_SIZE(products); i++) {
if (board_id == products[i].board_id) {
c->product_name = products[i].product_name;
c->access = *(products[i].access);
break;
}
}
- if (i == NR_PRODUCTS) {
+ if (i == ARRAY_SIZE(products)) {
printk(KERN_WARNING "cciss: Sorry, I don't know how"
" to access the Smart Array controller %08lx\n",
(unsigned long)board_id);