staging: ks7010: Use the ARRAY_SIZE() macro to calculate array sizes.
authorQuytelda Kahja <quytelda@tamalin.org>
Sat, 31 Mar 2018 06:07:41 +0000 (23:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:15:15 +0000 (14:15 +0200)
This macro, provided in 'linux/kernel.h', will calculate the size
more succinctly than a division operation.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_wlan_net.c

index 9078e13b0d4af5fc32e3d862d2b7104fd69977d1..533feef604a9096988607d102ab578bb72baeba0 100644 (file)
@@ -2702,10 +2702,9 @@ static const iw_handler ks_wlan_private_handler[] = {
 };
 
 static const struct iw_handler_def ks_wlan_handler_def = {
-       .num_standard = sizeof(ks_wlan_handler) / sizeof(iw_handler),
-       .num_private = sizeof(ks_wlan_private_handler) / sizeof(iw_handler),
-       .num_private_args =
-           sizeof(ks_wlan_private_args) / sizeof(struct iw_priv_args),
+       .num_standard = ARRAY_SIZE(ks_wlan_handler),
+       .num_private = ARRAY_SIZE(ks_wlan_private_handler),
+       .num_private_args = ARRAY_SIZE(ks_wlan_private_args),
        .standard = (iw_handler *)ks_wlan_handler,
        .private = (iw_handler *)ks_wlan_private_handler,
        .private_args = (struct iw_priv_args *)ks_wlan_private_args,