aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/usb/kalmia.c
diff options
context:
space:
mode:
authorColin Ian King2018-03-02 13:42:39 +0000
committerDavid S. Miller2018-03-02 10:01:04 -0500
commitb72c8a7e2ca8c4c085c76d17005241eca2edf93a (patch)
treed452a1da68c2442d8682c88bc07b5dd94570fa9d /drivers/net/usb/kalmia.c
parent3c34cb9defb0d454be20287c1c7c7417ebce7bb3 (diff)
net/usb/kalmia: use ARRAY_SIZE for various array sizing calculations
Use the ARRAY_SIZE macro on a couple of arrays to determine size of the arrays. Also fix up alignment to clean up a checkpatch warning. Improvement suggested by Coccinelle. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/kalmia.c')
-rw-r--r--drivers/net/usb/kalmia.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c
index ce0b0b4e3a57..1ec523b0e932 100644
--- a/drivers/net/usb/kalmia.c
+++ b/drivers/net/usb/kalmia.c
@@ -114,14 +114,14 @@ kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr)
return -ENOMEM;
memcpy(usb_buf, init_msg_1, 12);
- status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_1)
- / sizeof(init_msg_1[0]), usb_buf, 24);
+ status = kalmia_send_init_packet(dev, usb_buf, ARRAY_SIZE(init_msg_1),
+ usb_buf, 24);
if (status != 0)
return status;
memcpy(usb_buf, init_msg_2, 12);
- status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2)
- / sizeof(init_msg_2[0]), usb_buf, 28);
+ status = kalmia_send_init_packet(dev, usb_buf, ARRAY_SIZE(init_msg_2),
+ usb_buf, 28);
if (status != 0)
return status;