diff options
author | Stoyan Gaydarov <sgayda2@uiuc.edu> | 2009-07-22 07:02:27 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 23:02:06 +0400 |
commit | b6ac161364eccce1bea4a23a9de395883e90d7ab (patch) | |
tree | 67c09dab1846a84fb0030ccfcd6f5b5a228a5eb0 /drivers/staging/comedi | |
parent | 2e9ab1e72c631041f8a1c1d1fc7e5359e7e4a476 (diff) | |
download | linux-b6ac161364eccce1bea4a23a9de395883e90d7ab.tar.xz |
Staging: ARRAY_SIZE changes
These changes were a direct result of using a semantic patch
More information can be found at http://www.emn.fr/x-info/coccinelle/
Signed-off-by: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_pci230.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/cb_das16_cs.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/das08_cs.c | 3 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_6527.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_65xx.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_660x.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_670x.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_atmio16d.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_pcidio.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_pcimio.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/pcmad.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/poc.c | 2 |
12 files changed, 12 insertions, 13 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c index c4d8c4cae4a5..091a1a5822a8 100644 --- a/drivers/staging/comedi/drivers/amplc_pci230.c +++ b/drivers/staging/comedi/drivers/amplc_pci230.c @@ -513,7 +513,7 @@ MODULE_DEVICE_TABLE(pci, pci230_pci_table); /* * Useful for shorthand access to the particular board structure */ -#define n_pci230_boards (sizeof(pci230_boards)/sizeof(pci230_boards[0])) +#define n_pci230_boards ARRAY_SIZE(pci230_boards) #define thisboard ((const struct pci230_board *)dev->board_ptr) /* this structure is for data unique to this hardware driver. If diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c index 2f7aa3b5ef8e..12d12b43a6f1 100644 --- a/drivers/staging/comedi/drivers/cb_das16_cs.c +++ b/drivers/staging/comedi/drivers/cb_das16_cs.c @@ -78,7 +78,7 @@ static const struct das16cs_board das16cs_boards[] = { }, }; -#define n_boards (sizeof(das16cs_boards)/sizeof(das16cs_boards[0])) +#define n_boards ARRAY_SIZE(das16cs_boards) #define thisboard ((const struct das16cs_board *)dev->board_ptr) struct das16cs_private { diff --git a/drivers/staging/comedi/drivers/das08_cs.c b/drivers/staging/comedi/drivers/das08_cs.c index 74fcc1086c51..9cab21eaaa18 100644 --- a/drivers/staging/comedi/drivers/das08_cs.c +++ b/drivers/staging/comedi/drivers/das08_cs.c @@ -65,8 +65,7 @@ static struct comedi_driver driver_das08_cs = { .attach = das08_cs_attach, .detach = das08_common_detach, .board_name = &das08_cs_boards[0].name, - .num_names = sizeof(das08_cs_boards) / - sizeof(struct das08_board_struct), + .num_names = ARRAY_SIZE(das08_cs_boards), .offset = sizeof(struct das08_board_struct), }; diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c index 7a49dfce67be..b37ef37c2d2d 100644 --- a/drivers/staging/comedi/drivers/ni_6527.c +++ b/drivers/staging/comedi/drivers/ni_6527.c @@ -103,7 +103,7 @@ static const struct ni6527_board ni6527_boards[] = { }, }; -#define n_ni6527_boards (sizeof(ni6527_boards)/sizeof(ni6527_boards[0])) +#define n_ni6527_boards ARRAY_SIZE(ni6527_boards) #define this_board ((const struct ni6527_board *)dev->board_ptr) static DEFINE_PCI_DEVICE_TABLE(ni6527_pci_table) = { diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index 8079c41b7338..6b118c15b49e 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c @@ -246,7 +246,7 @@ static const struct ni_65xx_board ni_65xx_boards[] = { }, }; -#define n_ni_65xx_boards (sizeof(ni_65xx_boards)/sizeof(ni_65xx_boards[0])) +#define n_ni_65xx_boards ARRAY_SIZE(ni_65xx_boards) static inline const struct ni_65xx_board *board(struct comedi_device *dev) { return dev->board_ptr; diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 772c9372e435..404d3c516ed1 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -454,7 +454,7 @@ static inline const struct ni_660x_board *board(struct comedi_device *dev) return dev->board_ptr; } -#define n_ni_660x_boards (sizeof(ni_660x_boards)/sizeof(ni_660x_boards[0])) +#define n_ni_660x_boards ARRAY_SIZE(ni_660x_boards) static int ni_660x_attach(struct comedi_device *dev, struct comedi_devconfig *it); diff --git a/drivers/staging/comedi/drivers/ni_670x.c b/drivers/staging/comedi/drivers/ni_670x.c index 89ce5b873ffe..9b43547e80a1 100644 --- a/drivers/staging/comedi/drivers/ni_670x.c +++ b/drivers/staging/comedi/drivers/ni_670x.c @@ -111,7 +111,7 @@ struct ni_670x_private { }; #define devpriv ((struct ni_670x_private *)dev->private) -#define n_ni_670x_boards (sizeof(ni_670x_boards)/sizeof(ni_670x_boards[0])) +#define n_ni_670x_boards ARRAY_SIZE(ni_670x_boards) static int ni_670x_attach(struct comedi_device *dev, struct comedi_devconfig *it); diff --git a/drivers/staging/comedi/drivers/ni_atmio16d.c b/drivers/staging/comedi/drivers/ni_atmio16d.c index cde30b77a15f..901833d9b772 100644 --- a/drivers/staging/comedi/drivers/ni_atmio16d.c +++ b/drivers/staging/comedi/drivers/ni_atmio16d.c @@ -121,7 +121,7 @@ static const struct atmio16_board_t atmio16_boards[] = { }, }; -#define n_atmio16_boards sizeof(atmio16_boards)/sizeof(atmio16_boards[0]) +#define n_atmio16_boards ARRAY_SIZE(atmio16_boards) #define boardtype ((const struct atmio16_board_t *)dev->board_ptr) diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c index 15148d1642d4..52b2eca9e73d 100644 --- a/drivers/staging/comedi/drivers/ni_pcidio.c +++ b/drivers/staging/comedi/drivers/ni_pcidio.c @@ -374,7 +374,7 @@ static const struct nidio_board nidio_boards[] = { }, }; -#define n_nidio_boards (sizeof(nidio_boards)/sizeof(nidio_boards[0])) +#define n_nidio_boards ARRAY_SIZE(nidio_boards) #define this_board ((const struct nidio_board *)dev->board_ptr) static DEFINE_PCI_DEVICE_TABLE(ni_pcidio_pci_table) = { diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index 0dc639212ade..19d87553d906 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1208,7 +1208,7 @@ static const struct ni_board_struct ni_boards[] = { }, }; -#define n_pcimio_boards ((sizeof(ni_boards)/sizeof(ni_boards[0]))) +#define n_pcimio_boards ARRAY_SIZE(ni_boards) static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it); diff --git a/drivers/staging/comedi/drivers/pcmad.c b/drivers/staging/comedi/drivers/pcmad.c index 7368bf3011c9..acac67090810 100644 --- a/drivers/staging/comedi/drivers/pcmad.c +++ b/drivers/staging/comedi/drivers/pcmad.c @@ -69,7 +69,7 @@ static const struct pcmad_board_struct pcmad_boards[] = { }; #define this_board ((const struct pcmad_board_struct *)(dev->board_ptr)) -#define n_pcmad_boards (sizeof(pcmad_boards)/sizeof(pcmad_boards[0])) +#define n_pcmad_boards ARRAY_SIZE(pcmad_boards) struct pcmad_priv_struct { int differential; diff --git a/drivers/staging/comedi/drivers/poc.c b/drivers/staging/comedi/drivers/poc.c index 729a0d8766e8..d23e588d0632 100644 --- a/drivers/staging/comedi/drivers/poc.c +++ b/drivers/staging/comedi/drivers/poc.c @@ -102,7 +102,7 @@ static const struct boarddef_struct boards[] = { }, }; -#define n_boards (sizeof(boards)/sizeof(boards[0])) +#define n_boards ARRAY_SIZE(boards) #define this_board ((const struct boarddef_struct *)dev->board_ptr) static struct comedi_driver driver_poc = { |