staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal()
PATCH v2 1/1 staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal()
When comparing MAC addresses, use ether_addr_equal instead of memcmp to ETH_ALEN length.
--- drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/core/rtw_ap.c +2 -2
@@ -1163,7 +1163,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); plist = plist->next; -if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { +if (!ether_addr_equal (paclnode->addr, addr)) {if (paclnode->valid) { added = true;DBG_88E ("%s, sta has been added\n" , __func__);
@@ -1223,7 +1223,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); plist = plist->next; -if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { +if (!ether_addr_equal (paclnode->addr, addr,ETH_ALEN )) {if (paclnode->valid) { paclnode->valid = false;
Signature · 1 line
1.9.1
Quoted 2 lines · Anchal Jain
When comparing MAC addresses, use
ether_addr_equalinstead of memcmp toETH_ALENlength.
The definition of ether_addr_equal says that this function can only be used if some alignment constraints are met. So you have to show that this is the case. Look at patches that others have sent on this issue.
julia
Quoted 38 lines
Signed-off-by Anchal Jain <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/rtl8188eu/core/rtw_ap.c +2
-3@@ -1163,7 +1163,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); plist = plist->next; -if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { +if (!ether_addr_equal (paclnode->addr, addr)) {if (paclnode->valid) { added = true;DBG_88E ("%s, sta has been added\n" , __func__);@@ -1223,7 +1223,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); plist = plist->next; -if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { +if (!ether_addr_equal (paclnode->addr, addr,ETH_ALEN )) {if (paclnode->valid) { paclnode->valid = false; --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20161002160401.GA4550%40life-desktop.
For more options, visit https://groups.google.com/d/optout.
Greg KH
maintainerQuoted 32 lines · Anchal Jain
When comparing MAC addresses, use
ether_addr_equalinstead of memcmp toETH_ALENlength.Signed-off-by Anchal Jain <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/rtl8188eu/core/rtw_ap.c +2
-2@@ -1163,7 +1163,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); plist = plist->next; -if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { +if (!ether_addr_equal (paclnode->addr, addr)) {if (paclnode->valid) { added = true;DBG_88E ("%s, sta has been added\n" , __func__);@@ -1223,7 +1223,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); plist = plist->next; -if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { +if (!ether_addr_equal (paclnode->addr, addr,ETH_ALEN )) {if (paclnode->valid) { paclnode->valid = false;Signature · 1 line
1.9.1
I don't see a change here that will fix the build warnings, what did you do differently from version 1?
Always put that information in the patch, below the --- line, as it is described in Documentation/SubmittingPatches
thanks,
greg k-h
Greg KH
maintainerQuoted 31 lines · Greg KH
Quoted 30 lines · Anchal Jain
When comparing MAC addresses, use
ether_addr_equalinstead of memcmp toETH_ALENlength.Signed-off-by Anchal Jain <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/rtl8188eu/core/rtw_ap.c +2
-2@@ -1163,7 +1163,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); plist = plist->next; -if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { +if (!ether_addr_equal (paclnode->addr, addr)) {if (paclnode->valid) { added = true;DBG_88E ("%s, sta has been added\n" , __func__);@@ -1223,7 +1223,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) paclnode = container_of(plist, struct rtw_wlan_acl_node, list); plist = plist->next; -if (!memcmp (paclnode->addr, addr,ETH_ALEN )) { +if (!ether_addr_equal (paclnode->addr, addr,ETH_ALEN )) {if (paclnode->valid) { paclnode->valid = false;
Quoted 8 lines
Quoted 2 lines
Signature · 1 line
1.9.1I don't see a change here that will fix the build warnings, what did you do differently from version 1?
Always put that information in the patch, below the --- line, as it is described in
Documentation/SubmittingPatches
Also, you didn't test this, why not? That's a bit rude to not do so, don't you think?