2014-01-06 20:00:18

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH v3.5 18/19] rtlwifi: slight optimization of addr compare

On Thu, Dec 26, 2013 at 04:47:50PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 26-12-2013 15:41, Ding Tianhong wrote:
>
> >Use possibly more efficient ether_addr_equal_unaligned
> >instead of memcmp.
>
> >Cc: Larry Finger <[email protected]>
> >Cc: Chaoming Li <[email protected]>
> >Cc: John W. Linville <[email protected]>
> >Cc: [email protected]
> >Cc: [email protected]
> >Cc: [email protected]
> >Signed-off-by: Weilong Chen <[email protected]>
> >Signed-off-by: Ding Tianhong <[email protected]>
> >---
> > drivers/net/wireless/rtlwifi/cam.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> >diff --git a/drivers/net/wireless/rtlwifi/cam.c b/drivers/net/wireless/rtlwifi/cam.c
> >index 0e510f7..0276153 100644
> >--- a/drivers/net/wireless/rtlwifi/cam.c
> >+++ b/drivers/net/wireless/rtlwifi/cam.c
> [...]
> >@@ -335,7 +335,7 @@ void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 *sta_addr)
> > addr = rtlpriv->sec.hwsec_cam_sta_addr[i];
> > bitmap = (rtlpriv->sec.hwsec_cam_bitmap) >> i;
> > if (((bitmap & BIT(0)) == BIT(0)) &&
> >- (memcmp(addr, sta_addr, ETH_ALEN) == 0)) {
> >+ (ether_addr_equal_unaligned(addr, sta_addr))) {
>
> It's pointless to enclose function call in parens, again.

I'll correct that issue when merging the patch.

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.


2014-01-06 21:00:24

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH v3.5 18/19] rtlwifi: slight optimization of addr compare

On Mon, Jan 06, 2014 at 02:53:02PM -0500, John W. Linville wrote:
> On Thu, Dec 26, 2013 at 04:47:50PM +0400, Sergei Shtylyov wrote:
> > Hello.
> >
> > On 26-12-2013 15:41, Ding Tianhong wrote:
> >
> > >Use possibly more efficient ether_addr_equal_unaligned
> > >instead of memcmp.
> >
> > >Cc: Larry Finger <[email protected]>
> > >Cc: Chaoming Li <[email protected]>
> > >Cc: John W. Linville <[email protected]>
> > >Cc: [email protected]
> > >Cc: [email protected]
> > >Cc: [email protected]
> > >Signed-off-by: Weilong Chen <[email protected]>
> > >Signed-off-by: Ding Tianhong <[email protected]>
> > >---
> > > drivers/net/wireless/rtlwifi/cam.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > >diff --git a/drivers/net/wireless/rtlwifi/cam.c b/drivers/net/wireless/rtlwifi/cam.c
> > >index 0e510f7..0276153 100644
> > >--- a/drivers/net/wireless/rtlwifi/cam.c
> > >+++ b/drivers/net/wireless/rtlwifi/cam.c
> > [...]
> > >@@ -335,7 +335,7 @@ void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 *sta_addr)
> > > addr = rtlpriv->sec.hwsec_cam_sta_addr[i];
> > > bitmap = (rtlpriv->sec.hwsec_cam_bitmap) >> i;
> > > if (((bitmap & BIT(0)) == BIT(0)) &&
> > >- (memcmp(addr, sta_addr, ETH_ALEN) == 0)) {
> > >+ (ether_addr_equal_unaligned(addr, sta_addr))) {
> >
> > It's pointless to enclose function call in parens, again.
>
> I'll correct that issue when merging the patch.

Well, that was the plan... But since ether_addr_equal_unaligned
isn't in the wireless trees at the moment, it will have to wait or go
through another tree that has that definition. Feel free to respin
with the extra parenthesis removed...

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.