diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2012-04-10 16:06:41 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-10 15:25:55 -0700 |
commit | b330f606ed7591dc078acd856454e3a383299fb3 (patch) | |
tree | bece1f0a5a667ad12bd5e1f534056810266084eb /drivers/staging/media | |
parent | 487db48506513fa80138951f081db3d12b36b7e1 (diff) | |
download | blackbird-obmc-linux-b330f606ed7591dc078acd856454e3a383299fb3.tar.gz blackbird-obmc-linux-b330f606ed7591dc078acd856454e3a383299fb3.zip |
staging: replace open-coded ARRAY_SIZEs
spatch http://coccinelle.lip6.fr/rules/array.cocci did these.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/as102/as102_usb_drv.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c index 0f6bfe7eccba..36150e5c62de 100644 --- a/drivers/staging/media/as102/as102_usb_drv.c +++ b/drivers/staging/media/as102/as102_usb_drv.c @@ -367,7 +367,7 @@ static int as102_usb_probe(struct usb_interface *intf, ENTER(); /* This should never actually happen */ - if ((sizeof(as102_usb_id_table) / sizeof(struct usb_device_id)) != + if (ARRAY_SIZE(as102_usb_id_table) != (sizeof(as102_device_names) / sizeof(const char *))) { pr_err("Device names table invalid size"); return -EINVAL; @@ -380,8 +380,7 @@ static int as102_usb_probe(struct usb_interface *intf, } /* Assign the user-friendly device name */ - for (i = 0; i < (sizeof(as102_usb_id_table) / - sizeof(struct usb_device_id)); i++) { + for (i = 0; i < ARRAY_SIZE(as102_usb_id_table); i++) { if (id == &as102_usb_id_table[i]) { as102_dev->name = as102_device_names[i]; as102_dev->elna_cfg = as102_elna_cfg[i]; |