Skip to contentSkip to conversation

staging: comedi: ke_counter: remove the cnt_board_nbr macro

PATCH In review H Hartley Sweeten 1 participant 1 message Jul 19, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 81/90 staging: comedi: ke_counter: remove the cnt_board_nbr macro

This macro is an open-coded version of ARRAY_SIZE(). Use that instead.

Cc Ian Abbott <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/comedi/drivers/ke_counter.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/comedi/drivers/ke_counter.c +1 -3
index 4153977..d4e9292 100644
@@ -62,8 +62,6 @@ static const struct cnt_board_struct cnt_boards[] = {
 	 .cnt_bits = 24}
 };
 
-#define cnt_board_nbr (sizeof(cnt_boards)/sizeof(struct cnt_board_struct))
-
 /*-- counter write ----------------------------------------------------------*/
 
 /* This should be used only for resetting the counters; maybe it is better
@@ -132,7 +130,7 @@ static struct pci_dev *cnt_find_pci_dev(struct comedi_device *dev,
 		if (pcidev->vendor != PCI_VENDOR_ID_KOLTER)
 			continue;
 
-		for (i = 0; i < cnt_board_nbr; i++) {
+		for (i = 0; i < ARRAY_SIZE(cnt_boards); i++) {
 			board = &cnt_boards[i];
 			if (board->device_id != pcidev->device)
 				continue;
Signature · 1 line
1.7.11