[PATCH 09/12] staging: ks7010: replace magic number 6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Function uses magic number 6. Number refers to the number of octets in
an 802.11 MAC ethernet address and as such, already has a global
constant defined ETH_ALEN (header is already included).

include/uapi/linux/if_ether.h
 define ETH_ALEN	6	/* Octets in one ethernet addr	 */

Replace magic number 6 with ETH_ALEN.

Signed-off-by: Tobin C. Harding <me@xxxxxxxx>
---
 drivers/staging/ks7010/ks_hostif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 0455cda..18c006d 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1154,7 +1154,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
 	}
 
 	DPRINTK(4, "skb_buff length=%d\n", skb_len);
-	pp = kmalloc(hif_align_size(sizeof(*pp) + 6 + skb_len + MICHAEL_MIC_LEN),
+	pp = kmalloc(hif_align_size(sizeof(*pp) + ETH_ALEN + skb_len + MICHAEL_MIC_LEN),
 		     KS_WLAN_MEM_FLAG);
 
 	if (!pp) {
-- 
2.7.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux