From: Joe Perches <joe@perches.com>
To: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: "David S. Miller" <davem@davemloft.net>,
"John W. Linville" <linville@tuxdriver.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/3] drivers/net: Convert compare_ether_addr to ether_addr_equal
Date: Thu, 10 May 2012 09:11:28 -0700 [thread overview]
Message-ID: <1336666288.22495.14.camel@joe2Laptop> (raw)
In-Reply-To: <20120510173201.16131du3cg90nybo@www.81.fi>
(cc's trimmed)
On Thu, 2012-05-10 at 17:32 +0300, Jussi Kivilinna wrote:
> Quoting Joe Perches <joe@perches.com>:
> > Use the new bool function ether_addr_equal to add
> > some clarity and reduce the likelihood for misuse
> > of compare_ether_addr for sorting.
[]
> > diff --git a/drivers/net/wireless/rndis_wlan.c
[]
> > @@ -2139,7 +2139,7 @@ resize_buf:
> > while (check_bssid_list_item(bssid, bssid_len, buf, len)) {
> > if (rndis_bss_info_update(usbdev, bssid) && match_bssid &&
> > matched) {
> > - if (compare_ether_addr(bssid->mac, match_bssid))
> > + if (!ether_addr_equal(bssid->mac, match_bssid))
>
> While reviewing this, noticed that above original code is wrong. It
> should be !compare_ether_addr. So do I push patch fixing this through
> wireless-testing althought it will later cause conflict with this patch?
>
> -Jussi
>
> > *matched = true;
> > }
> >
Up to John.
Here's the patch I would send against net-next
updating the test and the style a little.
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index dcf0e7e..29cccc5 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2137,11 +2137,10 @@ resize_buf:
* received 'num_items' and walking through full bssid buffer instead.
*/
while (check_bssid_list_item(bssid, bssid_len, buf, len)) {
- if (rndis_bss_info_update(usbdev, bssid) && match_bssid &&
- matched) {
- if (!ether_addr_equal(bssid->mac, match_bssid))
- *matched = true;
- }
+ if (rndis_bss_info_update(usbdev, bssid) &&
+ match_bssid && matched &&
+ ether_addr_equal(bssid->mac, match_bssid))
+ *matched = true;
real_count++;
bssid = next_bssid_list_item(bssid, &bssid_len, buf, len);
next prev parent reply other threads:[~2012-05-10 16:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-10 3:04 [PATCH 0/3] net,drivers/net: Use ether_addr_equal and ether_addr_equal_64bits Joe Perches
2012-05-10 3:04 ` [PATCH 2/3] etherdevice.h: Add ether_addr_equal_64bits Joe Perches
2012-05-11 3:35 ` David Miller
2012-05-10 3:04 ` [PATCH 3/3] net,drivers/net: Convert compare_ether_addr_64bits to ether_addr_equal_64bits Joe Perches
2012-05-11 3:35 ` David Miller
2012-05-11 22:21 ` [PATCH net-next] etherdevice: Remove now unused compare_ether_addr_64bits Joe Perches
2012-05-13 3:35 ` David Miller
2012-05-10 3:17 ` [PATCH 1/3] drivers/net: Convert compare_ether_addr to ether_addr_equal Joe Perches
[not found] ` <7c9881a67c52c2f218480b6742155b6d6928122d.1336618708.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2012-05-10 14:32 ` Jussi Kivilinna
2012-05-10 16:11 ` Joe Perches [this message]
2012-05-10 16:33 ` David Miller
2012-05-31 12:01 ` Jussi Kivilinna
[not found] ` <20120531150124.119853l3a0cbvj40-tzMWlZeEOor1KXRcyAk9cg@public.gmane.org>
2012-05-31 18:49 ` Joe Perches
2012-05-10 16:30 ` David Miller
2012-05-10 20:15 ` Jussi Kivilinna
2012-05-11 3:35 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336666288.22495.14.camel@joe2Laptop \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=jussi.kivilinna@mbnet.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox