linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] staging: wilc1000: use pre-defined macro is_broadcast_ether_addr
@ 2018-03-12  9:39 hariprasath.elango
  2018-03-13  7:30 ` Ajay Singh
  0 siblings, 1 reply; 4+ messages in thread
From: hariprasath.elango @ 2018-03-12  9:39 UTC (permalink / raw)
  To: aditya.shankar
  Cc: devel, vbabu3, Greg Kroah-Hartman, linux-wireless, linux-kernel,
	hariprasath.elango, Ganesh Krishna

From: HariPrasath Elango <hariprasath.elango@gmail.com>

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

Signed-off-by: HariPrasath Elango <hariprasath.elango@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index bbdfc7a..f93f411 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -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;
-- 
2.10.0.GIT

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] staging: wilc1000: use pre-defined macro is_broadcast_ether_addr
  2018-03-12  9:39 [PATCHv2] staging: wilc1000: use pre-defined macro is_broadcast_ether_addr hariprasath.elango
@ 2018-03-13  7:30 ` Ajay Singh
  2018-03-13  9:58   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Ajay Singh @ 2018-03-13  7:30 UTC (permalink / raw)
  To: hariprasath.elango, linux-kernel
  Cc: devel, vbabu3, Greg Kroah-Hartman, linux-wireless,
	Ganesh Krishna, aditya.shankar


Reviewed-by: Ajay Singh <ajay.kathat@microchip.com>

On Mon, 12 Mar 2018 15:09:03 +0530
<hariprasath.elango@gmail.com> wrote:

> From: HariPrasath Elango <hariprasath.elango@gmail.com>
>

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

> Use the kernel pre-defined macro is_broadcast_ether_addr() instead of
> doing a memcmp here.
> 
> Signed-off-by: HariPrasath Elango <hariprasath.elango@gmail.com>
> ---

Regards,
Ajay
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] staging: wilc1000: use pre-defined macro is_broadcast_ether_addr
  2018-03-13  7:30 ` Ajay Singh
@ 2018-03-13  9:58   ` Greg Kroah-Hartman
  2018-03-13 11:05     ` Ajay Singh
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2018-03-13  9:58 UTC (permalink / raw)
  To: Ajay Singh
  Cc: devel, vbabu3, linux-wireless, linux-kernel, hariprasath.elango,
	Ganesh Krishna, aditya.shankar

On Tue, Mar 13, 2018 at 01:00:51PM +0530, Ajay Singh wrote:
> 
> Reviewed-by: Ajay Singh <ajay.kathat@microchip.com>
> 
> On Mon, 12 Mar 2018 15:09:03 +0530
> <hariprasath.elango@gmail.com> wrote:
> 
> > From: HariPrasath Elango <hariprasath.elango@gmail.com>
> >
> 
> 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
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv2] staging: wilc1000: use pre-defined macro is_broadcast_ether_addr
  2018-03-13  9:58   ` Greg Kroah-Hartman
@ 2018-03-13 11:05     ` Ajay Singh
  0 siblings, 0 replies; 4+ messages in thread
From: Ajay Singh @ 2018-03-13 11:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, vbabu3, linux-wireless, linux-kernel, hariprasath.elango,
	Ganesh Krishna, aditya.shankar

On Tue, 13 Mar 2018 10:58:16 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Tue, Mar 13, 2018 at 01:00:51PM +0530, Ajay Singh wrote:
> > 
> > Reviewed-by: Ajay Singh <ajay.kathat@microchip.com>
> > 
> > On Mon, 12 Mar 2018 15:09:03 +0530
> > <hariprasath.elango@gmail.com> wrote:
> >   
> > > From: HariPrasath Elango <hariprasath.elango@gmail.com>
> > >  
> > 
> > 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
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-13 11:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12  9:39 [PATCHv2] staging: wilc1000: use pre-defined macro is_broadcast_ether_addr hariprasath.elango
2018-03-13  7:30 ` Ajay Singh
2018-03-13  9:58   ` Greg Kroah-Hartman
2018-03-13 11:05     ` Ajay Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).