Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal

2021-04-15 Thread Mitali Borkar
On Wed, Apr 14, 2021 at 10:55:25AM +0300, Dan Carpenter wrote:
> On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> > Added a generic function of static inline bool in
> > include/linux/etherdevice.h to replace memcmp with
> > ether_oui_equal throughout the execution.
> > Corrected the misspelled words in this file.
> > 
> > Signed-off-by: Mitali Borkar 
> > ---
> >  
> > Changes from v1:- Rectified spelling mistake and replaced memcmp with
> > ether_oui_equal.
> > 
> >  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++
> >  include/linux/etherdevice.h   |  5 +++
>^^^
> This is networking code and not staging code, but the netdev mailing
> list isn't CC'd.
>
I didn't knew mail id then, I will look into this,

> >  2 files changed, 29 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> > b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > index ec6b46166e84..ce58feb2af9a 100644
> > --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
> >  810, 720, 810, 900, 900, 990} }
> >  };
> >  
> > -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> > +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
> 
> Please pull this spelling fix into its own patch.
> 
Okay Sir.

> [ snip ]
> 
> > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> > index 2e5debc0373c..6a1a63168319 100644
> > --- a/include/linux/etherdevice.h
> > +++ b/include/linux/etherdevice.h
> > @@ -87,6 +87,11 @@ static inline bool is_link_local_ether_addr(const u8 
> > *addr)
> >  #endif
> >  }
> >  
> > +static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
> > +{
> > +return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
> > +}
> 
> The indenting is messed up on this.
>
OKay Sir, I am looking into this.

> regards,
> dan carpenter
> 


Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal

2021-04-15 Thread Greg KH
On Thu, Apr 15, 2021 at 07:12:47PM +0530, Mitali Borkar wrote:
> On Wed, Apr 14, 2021 at 10:16:59AM +0200, Greg KH wrote:
> > On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> > > Added a generic function of static inline bool in
> > > include/linux/etherdevice.h to replace memcmp with
> > > ether_oui_equal throughout the execution.
> > > Corrected the misspelled words in this file.
> > > 
> > > Signed-off-by: Mitali Borkar 
> > > ---
> > >  
> > > Changes from v1:- Rectified spelling mistake and replaced memcmp with
> > > ether_oui_equal.
> > > 
> > >  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++
> > >  include/linux/etherdevice.h   |  5 +++
> > >  2 files changed, 29 insertions(+), 24 deletions(-)
> > > 
> > > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> > > b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > > index ec6b46166e84..ce58feb2af9a 100644
> > > --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > > +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > > @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
> > >810, 720, 810, 900, 900, 990} }
> > >  };
> > >  
> > > -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> > > +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
> > >  
> > >  static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
> > >  
> > > @@ -146,16 +146,16 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
> > >   boolretValue = false;
> > >   struct rtllib_network *net = >current_network;
> > >  
> > > - if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> > > - (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> > > - (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> > > - (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> > > - (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> > > + if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> > > + (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> > > + (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> > > + (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> > > + (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> > >   (net->ralink_cap_exist))
> > >   retValue = true;
> > > - else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > > -  !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > > -  !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> > > + else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> > > +  ether_oui_equal(net->bssid, 
> > > LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> > > +  ether_oui_equal(net->bssid, 
> > > LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
> > >(net->broadcom_cap_exist))
> > >   retValue = true;
> > >   else if (net->bssht.bd_rt2rt_aggregation)
> > > @@ -179,26 +179,26 @@ static void HTIOTPeerDetermine(struct rtllib_device 
> > > *ieee)
> > >   pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
> > >   } else if (net->broadcom_cap_exist) {
> > >   pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> > > - } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > > -  !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > > -  !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
> > > + } else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> > > +ether_oui_equal(net->bssid, 
> > > LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> > > +ether_oui_equal(net->bssid, 
> > > LINKSYSWRT350_LINKSYSWRT150_BROADCOM)) {
> > >   pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> > > - } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> > > -  (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> > > -  (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> > > -  (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> > > -  (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> > > -   net->ralink_cap_exist) {
> > > + } else if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> > > +(ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) 
> > > ||
> > > +(ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> > > +(ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> > > +(ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> > > +net->ralink_cap_exist) {
> > >   pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
> > >   } else if ((net->atheros_cap_exist) ||
> > > - (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
> > > - (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
> > > +(ether_oui_equal(net->bssid, DLINK_ATHEROS_1) == 0) ||
> > > +(ether_oui_equal(net->bssid, DLINK_ATHEROS_2) == 0)) {
> > >   pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
> > > - } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
> 

Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal

2021-04-15 Thread Mitali Borkar
On Wed, Apr 14, 2021 at 10:16:59AM +0200, Greg KH wrote:
> On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> > Added a generic function of static inline bool in
> > include/linux/etherdevice.h to replace memcmp with
> > ether_oui_equal throughout the execution.
> > Corrected the misspelled words in this file.
> > 
> > Signed-off-by: Mitali Borkar 
> > ---
> >  
> > Changes from v1:- Rectified spelling mistake and replaced memcmp with
> > ether_oui_equal.
> > 
> >  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++
> >  include/linux/etherdevice.h   |  5 +++
> >  2 files changed, 29 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> > b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > index ec6b46166e84..ce58feb2af9a 100644
> > --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
> >  810, 720, 810, 900, 900, 990} }
> >  };
> >  
> > -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> > +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
> >  
> >  static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
> >  
> > @@ -146,16 +146,16 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
> > boolretValue = false;
> > struct rtllib_network *net = >current_network;
> >  
> > -   if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> > -   (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> > -   (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> > -   (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> > -   (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> > +   if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> > +   (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> > +   (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> > +   (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> > +   (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> > (net->ralink_cap_exist))
> > retValue = true;
> > -   else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > -!memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > -!memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> > +   else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> > +ether_oui_equal(net->bssid, 
> > LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> > +ether_oui_equal(net->bssid, 
> > LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
> >  (net->broadcom_cap_exist))
> > retValue = true;
> > else if (net->bssht.bd_rt2rt_aggregation)
> > @@ -179,26 +179,26 @@ static void HTIOTPeerDetermine(struct rtllib_device 
> > *ieee)
> > pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
> > } else if (net->broadcom_cap_exist) {
> > pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> > -   } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > -!memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > -!memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
> > +   } else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> > +  ether_oui_equal(net->bssid, 
> > LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> > +  ether_oui_equal(net->bssid, 
> > LINKSYSWRT350_LINKSYSWRT150_BROADCOM)) {
> > pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> > -   } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> > -(memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> > -(memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> > -(memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> > -(memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> > - net->ralink_cap_exist) {
> > +   } else if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> > +  (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) 
> > ||
> > +  (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> > +  (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> > +  (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> > +  net->ralink_cap_exist) {
> > pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
> > } else if ((net->atheros_cap_exist) ||
> > -   (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
> > -   (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
> > +  (ether_oui_equal(net->bssid, DLINK_ATHEROS_1) == 0) ||
> > +  (ether_oui_equal(net->bssid, DLINK_ATHEROS_2) == 0)) {
> > pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
> > -   } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
> > - net->cisco_cap_exist) {
> > +   } else if ((ether_oui_equal(net->bssid, CISCO_BROADCOM) == 0) ||
> > +  

Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal

2021-04-14 Thread Greg KH
On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> Added a generic function of static inline bool in
> include/linux/etherdevice.h to replace memcmp with
> ether_oui_equal throughout the execution.
> Corrected the misspelled words in this file.
> 
> Signed-off-by: Mitali Borkar 
> ---
>  
> Changes from v1:- Rectified spelling mistake and replaced memcmp with
> ether_oui_equal.
> 
>  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++
>  include/linux/etherdevice.h   |  5 +++
>  2 files changed, 29 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> index ec6b46166e84..ce58feb2af9a 100644
> --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
>810, 720, 810, 900, 900, 990} }
>  };
>  
> -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
>  
>  static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
>  
> @@ -146,16 +146,16 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
>   boolretValue = false;
>   struct rtllib_network *net = >current_network;
>  
> - if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> - (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> - (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> - (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> - (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> + if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> + (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
> + (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> + (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> + (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
>   (net->ralink_cap_exist))
>   retValue = true;
> - else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> -  !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> -  !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> + else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> +  ether_oui_equal(net->bssid, 
> LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> +  ether_oui_equal(net->bssid, 
> LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
>(net->broadcom_cap_exist))
>   retValue = true;
>   else if (net->bssht.bd_rt2rt_aggregation)
> @@ -179,26 +179,26 @@ static void HTIOTPeerDetermine(struct rtllib_device 
> *ieee)
>   pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
>   } else if (net->broadcom_cap_exist) {
>   pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> - } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> -  !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> -  !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
> + } else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
> +ether_oui_equal(net->bssid, 
> LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
> +ether_oui_equal(net->bssid, 
> LINKSYSWRT350_LINKSYSWRT150_BROADCOM)) {
>   pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
> - } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
> -  (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
> -  (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
> -  (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
> -  (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
> -   net->ralink_cap_exist) {
> + } else if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
> +(ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) 
> ||
> +(ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
> +(ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
> +(ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
> +net->ralink_cap_exist) {
>   pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
>   } else if ((net->atheros_cap_exist) ||
> - (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
> - (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
> +(ether_oui_equal(net->bssid, DLINK_ATHEROS_1) == 0) ||
> +(ether_oui_equal(net->bssid, DLINK_ATHEROS_2) == 0)) {
>   pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
> - } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
> -   net->cisco_cap_exist) {
> + } else if ((ether_oui_equal(net->bssid, CISCO_BROADCOM) == 0) ||
> +net->cisco_cap_exist) {
>   pHTInfo->IOTPeer = HT_IOT_PEER_CISCO;
> - } else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 

Re: [PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal

2021-04-14 Thread Dan Carpenter
On Wed, Apr 14, 2021 at 12:26:01PM +0530, Mitali Borkar wrote:
> Added a generic function of static inline bool in
> include/linux/etherdevice.h to replace memcmp with
> ether_oui_equal throughout the execution.
> Corrected the misspelled words in this file.
> 
> Signed-off-by: Mitali Borkar 
> ---
>  
> Changes from v1:- Rectified spelling mistake and replaced memcmp with
> ether_oui_equal.
> 
>  drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++
>  include/linux/etherdevice.h   |  5 +++
   ^^^
This is networking code and not staging code, but the netdev mailing
list isn't CC'd.

>  2 files changed, 29 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> index ec6b46166e84..ce58feb2af9a 100644
> --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
> +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> @@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
>810, 720, 810, 900, 900, 990} }
>  };
>  
> -static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
> +static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};

Please pull this spelling fix into its own patch.

[ snip ]

> diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> index 2e5debc0373c..6a1a63168319 100644
> --- a/include/linux/etherdevice.h
> +++ b/include/linux/etherdevice.h
> @@ -87,6 +87,11 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
>  #endif
>  }
>  
> +static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
> +{
> +return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
> +}

The indenting is messed up on this.

regards,
dan carpenter



[PATCH v2 4/5] staging: rtl8192e: rectified spelling mistake and replace memcmp with ether_oui_equal

2021-04-14 Thread Mitali Borkar
Added a generic function of static inline bool in
include/linux/etherdevice.h to replace memcmp with
ether_oui_equal throughout the execution.
Corrected the misspelled words in this file.

Signed-off-by: Mitali Borkar 
---
 
Changes from v1:- Rectified spelling mistake and replaced memcmp with
ether_oui_equal.

 drivers/staging/rtl8192e/rtl819x_HTProc.c | 48 +++
 include/linux/etherdevice.h   |  5 +++
 2 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index ec6b46166e84..ce58feb2af9a 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -43,7 +43,7 @@ u16 MCS_DATA_RATE[2][2][77] = {
 810, 720, 810, 900, 900, 990} }
 };
 
-static u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
+static u8 UNKNOWN_BROADCOM[3] = {0x00, 0x14, 0xbf};
 
 static u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
 
@@ -146,16 +146,16 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
boolretValue = false;
struct rtllib_network *net = >current_network;
 
-   if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
-   (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
-   (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
-   (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
-   (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
+   if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
+   (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) ||
+   (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
+   (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
+   (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
(net->ralink_cap_exist))
retValue = true;
-   else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
-!memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
-!memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
+   else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
+ether_oui_equal(net->bssid, 
LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
+ether_oui_equal(net->bssid, 
LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
 (net->broadcom_cap_exist))
retValue = true;
else if (net->bssht.bd_rt2rt_aggregation)
@@ -179,26 +179,26 @@ static void HTIOTPeerDetermine(struct rtllib_device *ieee)
pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
} else if (net->broadcom_cap_exist) {
pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
-   } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
-!memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
-!memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
+   } else if (ether_oui_equal(net->bssid, UNKNOWN_BROADCOM) ||
+  ether_oui_equal(net->bssid, 
LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
+  ether_oui_equal(net->bssid, 
LINKSYSWRT350_LINKSYSWRT150_BROADCOM)) {
pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
-   } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
-(memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
-(memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
-(memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
-(memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
- net->ralink_cap_exist) {
+   } else if ((ether_oui_equal(net->bssid, BELKINF5D8233V1_RALINK) == 0) ||
+  (ether_oui_equal(net->bssid, BELKINF5D82334V3_RALINK) == 0) 
||
+  (ether_oui_equal(net->bssid, PCI_RALINK) == 0) ||
+  (ether_oui_equal(net->bssid, EDIMAX_RALINK) == 0) ||
+  (ether_oui_equal(net->bssid, AIRLINK_RALINK) == 0) ||
+  net->ralink_cap_exist) {
pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
} else if ((net->atheros_cap_exist) ||
-   (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
-   (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
+  (ether_oui_equal(net->bssid, DLINK_ATHEROS_1) == 0) ||
+  (ether_oui_equal(net->bssid, DLINK_ATHEROS_2) == 0)) {
pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
-   } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
- net->cisco_cap_exist) {
+   } else if ((ether_oui_equal(net->bssid, CISCO_BROADCOM) == 0) ||
+  net->cisco_cap_exist) {
pHTInfo->IOTPeer = HT_IOT_PEER_CISCO;
-   } else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) ||
- net->marvell_cap_exist) {
+   } else if ((ether_oui_equal(net->bssid, LINKSYS_MARVELL_4400N) == 0) ||
+