* [PATCH v2] staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal()
@ 2016-10-02 16:04 Anchal Jain
2016-10-02 16:09 ` [Outreachy kernel] " Julia Lawall
2016-10-02 16:11 ` Greg KH
0 siblings, 2 replies; 4+ messages in thread
From: Anchal Jain @ 2016-10-02 16:04 UTC (permalink / raw)
To: gregkh; +Cc: outreachy-kernel
When comparing MAC addresses, use ether_addr_equal instead of memcmp to
ETH_ALEN length.
Signed-off-by: Anchal Jain <anchalj109@gmail.com>
---
drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c
index fbe9941..6a3dc5e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH v2] staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal()
2016-10-02 16:04 [PATCH v2] staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal() Anchal Jain
@ 2016-10-02 16:09 ` Julia Lawall
2016-10-02 16:11 ` Greg KH
1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2016-10-02 16:09 UTC (permalink / raw)
To: Anchal Jain; +Cc: gregkh, outreachy-kernel
On Sun, 2 Oct 2016, Anchal Jain wrote:
> When comparing MAC addresses, use ether_addr_equal instead of memcmp to
> ETH_ALEN length.
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
>
> Signed-off-by: Anchal Jain <anchalj109@gmail.com>
> ---
> drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c
> index fbe9941..6a3dc5e 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_ap.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
> @@ -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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal()
2016-10-02 16:04 [PATCH v2] staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal() Anchal Jain
2016-10-02 16:09 ` [Outreachy kernel] " Julia Lawall
@ 2016-10-02 16:11 ` Greg KH
2016-10-02 16:11 ` Greg KH
1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2016-10-02 16:11 UTC (permalink / raw)
To: Anchal Jain; +Cc: outreachy-kernel
On Sun, Oct 02, 2016 at 09:34:17PM +0530, Anchal Jain wrote:
> When comparing MAC addresses, use ether_addr_equal instead of memcmp to
> ETH_ALEN length.
>
> Signed-off-by: Anchal Jain <anchalj109@gmail.com>
> ---
> drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c
> index fbe9941..6a3dc5e 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_ap.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
> @@ -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
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal()
2016-10-02 16:11 ` Greg KH
@ 2016-10-02 16:11 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2016-10-02 16:11 UTC (permalink / raw)
To: Anchal Jain; +Cc: outreachy-kernel
On Sun, Oct 02, 2016 at 06:11:20PM +0200, Greg KH wrote:
> On Sun, Oct 02, 2016 at 09:34:17PM +0530, Anchal Jain wrote:
> > When comparing MAC addresses, use ether_addr_equal instead of memcmp to
> > ETH_ALEN length.
> >
> > Signed-off-by: Anchal Jain <anchalj109@gmail.com>
> > ---
> > drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c
> > index fbe9941..6a3dc5e 100644
> > --- a/drivers/staging/rtl8188eu/core/rtw_ap.c
> > +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
> > @@ -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
>
> 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
Also, you didn't test this, why not? That's a bit rude to not do so,
don't you think?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-02 16:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-02 16:04 [PATCH v2] staging: rtl8188eu: core: rtw_ap: Replace memcmp() with ether_addr_equal() Anchal Jain
2016-10-02 16:09 ` [Outreachy kernel] " Julia Lawall
2016-10-02 16:11 ` Greg KH
2016-10-02 16:11 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.