Skip to content

Commit

Permalink
staging: comedi: me4000: remove ME4000_BOARD_VERSIONS
Browse files Browse the repository at this point in the history
Remove the terminating entry in the boardinfo so that ARRAY_SIZE
works correctly. Then remove ME4000_BOARD_VERSIONS and just use
ARRAY_SIZE in the probe.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 8, 2012
1 parent 5948ae2 commit 8293330
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/staging/comedi/drivers/me4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,8 @@ static const struct me4000_board me4000_boards[] = {
{"ME-4680i", 0x4681, {4, 4}, {32, 0, 16, 1}, {4}, {3} },
{"ME-4680s", 0x4682, {4, 4}, {32, 8, 16, 1}, {4}, {3} },
{"ME-4680is", 0x4683, {4, 4}, {32, 8, 16, 1}, {4}, {3} },

{0},
};

#define ME4000_BOARD_VERSIONS (ARRAY_SIZE(me4000_boards) - 1)

/*-----------------------------------------------------------------------------
Meilhaus function prototypes
---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -136,7 +132,7 @@ static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it)
*/
for_each_pci_dev(pci_device) {
if (pci_device->vendor == PCI_VENDOR_ID_MEILHAUS) {
for (i = 0; i < ME4000_BOARD_VERSIONS; i++) {
for (i = 0; i < ARRAY_SIZE(me4000_boards); i++) {
if (me4000_boards[i].device_id ==
pci_device->device) {
/*
Expand Down

0 comments on commit 8293330

Please sign in to comment.