Skip to contentSkip to conversation

staging: wilc1000: use pre-defined macro is_broadcast_ether_addr

PATCH In review [email protected] 3 participants 4 messages Mar 12, 2018 – Mar 13, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: wilc1000: use pre-defined macro is_broadcast_ether_addr

From: HariPrasath Elango <[email protected]>

Use the kernel pre-defined macro is_broadcast_ether_addr() instead of doing a memcmp here.

---
 drivers/staging/wilc1000/linux_mon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/wilc1000/linux_mon.c +1 -2
index bbdfc7a..f93f411 100644
@@ -27,7 +27,6 @@ static struct net_device *wilc_wfi_mon; /* global monitor netdev */
 
 static u8 srcadd[6];
 static u8 bssid[6];
-static u8 broadcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 /**
  *  @brief      WILC_WFI_monitor_rx
  *  @details
@@ -193,7 +192,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
 
 	skb_pull(skb, rtap_len);
 
-	if (skb->data[0] == 0xc0 && (!(memcmp(broadcast, &skb->data[4], 6)))) {
+	if (skb->data[0] == 0xc0 && is_broadcast_ether_addr(&skb->data[4])) {
 		skb2 = dev_alloc_skb(skb->len + sizeof(struct wilc_wfi_radiotap_cb_hdr));
 		if (!skb2)
 			return -ENOMEM;
Signature · 6 lines
2.10.0.GIT

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Reviewed-by on v2 1/1
#1 lore raw
Quoted 2 lines · On Mon, 12 Mar 2018 15:09:03 +0530 <[email protected]> wrote:

From: HariPrasath Elango <[email protected]>

Please avoid use of 'From' tag specially when there is only one 'Signed-off-by' tag and its same.

Quoted 5 lines

Use the kernel pre-defined macro is_broadcast_ether_addr() instead of doing a memcmp here.

---

Regards,
Ajay
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#2 lore raw
Quoted 11 lines · Ajay Singh
Quoted 2 lines · On Mon, 12 Mar 2018 15:09:03 +0530 <[email protected]> wrote:

From: HariPrasath Elango <[email protected]>

Please avoid use of 'From' tag specially when there is only one 'Signed-off-by' tag and its same.

But the email client isn't putting the correct info in the email header, so this line is needed.

And if it's redundant, not a problem, git handles it just fine, better to be safe.

thanks,

greg k-h

#3 lore raw
Quoted 10 lines · On Tue, 13 Mar 2018 10:58:16 +0100 Greg Kroah-Hartman…
Quoted 9 lines · Ajay Singh
Quoted 2 lines · On Mon, 12 Mar 2018 15:09:03 +0530 <[email protected]> wrote:

From: HariPrasath Elango <[email protected]>

Quoted 8 lines
Quoted 2 lines

Please avoid use of 'From' tag specially when there is only one 'Signed-off-by' tag and its same.

But the email client isn't putting the correct info in the email header, so this line is needed.

And if it's redundant, not a problem, git handles it just fine, better to be safe.

Thanks Greg, for giving the information.
In that case, we can keep the 'From:' tag to be on safe side.

Regards,
Ajay
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel