[PATCH 02/46] staging: comedi: adl_pci9111: remove pci9111_board_nbr macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This macro is an open-coded version of the kernels ARRAY_SIZE
macro. Use the kernel provided macro instead.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/adl_pci9111.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c
index cf3c43a..01a861d 100644
--- a/drivers/staging/comedi/drivers/adl_pci9111.c
+++ b/drivers/staging/comedi/drivers/adl_pci9111.c
@@ -332,9 +332,6 @@ static const struct pci9111_board pci9111_boards[] = {
 	 .ai_acquisition_period_min_ns = PCI9111_AI_ACQUISITION_PERIOD_MIN_NS}
 };
 
-#define pci9111_board_nbr \
-	(sizeof(pci9111_boards)/sizeof(struct pci9111_board))
-
 /*  Private data structure */
 
 struct pci9111_private_data {
@@ -1228,7 +1225,7 @@ static struct pci_dev *pci9111_find_pci(struct comedi_device *dev,
 	for_each_pci_dev(pcidev) {
 		if (pcidev->vendor != PCI_VENDOR_ID_ADLINK)
 			continue;
-		for (i = 0; i < pci9111_board_nbr; i++) {
+		for (i = 0; i < ARRAY_SIZE(pci9111_boards); i++) {
 			if (pcidev->device != pci9111_boards[i].device_id)
 				continue;
 			if (bus || slot) {
-- 
1.7.11

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux