net/usb/kalmia: use ARRAY_SIZE for various array sizing calculations
Subsystems (5)
PATCH 1/1 net/usb/kalmia: use ARRAY_SIZE for various array sizing calculations
From: Colin Ian King <[email protected]>
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 <[email protected]>
--- drivers/net/usb/kalmia.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/usb/kalmia.c +4 -4
@@ -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;
Signature · 1 line
2.15.1
From: Colin King <[email protected]>
Date: Fri, 2 Mar 2018 13:42:39 +0000
Quoted 7 lines
From: Colin Ian King <[email protected]>
Use the
ARRAY_SIZEmacro 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 <[email protected]>
Applied, thanks Colin.