linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: maowenan <maowenan@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <Larry.Finger@lwfinger.net>, <straube.linux@gmail.com>,
	<jananis37@gmail.com>, <devel@driverdev.osuosl.org>,
	<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	<davem@davemloft.net>
Subject: Re: [PATCH net] staging: rtl8188eu: use is_zero_ether_addr() instead of memcmp()
Date: Mon, 18 Mar 2019 21:57:14 +0800	[thread overview]
Message-ID: <eac0fbf3-c52c-fd76-06cf-5bd27f94b39f@huawei.com> (raw)
In-Reply-To: <20190317112647.GG4614@kroah.com>



On 2019/3/17 19:26, Greg KH wrote:
> On Sat, Mar 09, 2019 at 11:26:00AM +0800, Mao Wenan wrote:
>> Using is_zero_ether_addr() instead of directly use
>> memcmp() to determine if the ethernet address is all
>> zeros.
>>
>> Signed-off-by: Mao Wenan <maowenan@huawei.com>
>> ---
>>  drivers/staging/rtl8188eu/core/rtw_mlme.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
>> index 714f7a70ed64..beae367df93b 100644
>> --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
>> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
>> @@ -180,9 +180,8 @@ struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr)
>>  {
>>  	struct list_head *phead, *plist;
>>  	struct wlan_network *pnetwork = NULL;
>> -	u8 zero_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
>>  
>> -	if (!memcmp(zero_addr, addr, ETH_ALEN)) {
>> +	if (is_zero_ether_addr(addr)) {
> 
> As Joe said, you have to prove that this is properly aligned before you
> can call this function.  Please do so.

The previous function to call rtw_find_network(), has been aligned for parameter 'addr',
because it has been defined an arry[6];
such as unsigned char MacAddress[ETH_ALEN] in struct wlan_bssid_ex;
 179 struct wlan_bssid_ex {
 180         u32  Length;
 181         unsigned char MacAddress[ETH_ALEN];
 182         u8  Reserved[2];/* 0]: IS beacon frame */
 183         struct ndis_802_11_ssid  ssid;
 184         u32  Privacy;
 185         NDIS_802_11_RSSI  Rssi;/* in dBM,raw data ,get from PHY) */
 186         enum  NDIS_802_11_NETWORK_TYPE  NetworkTypeInUse;
 187         struct ndis_802_11_config  Configuration;
 188         enum ndis_802_11_network_infra  InfrastructureMode;
 189         unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
 190         struct wlan_phy_info    PhyInfo;
 191         u32  ie_length;
 192         u8  ies[MAX_IE_SZ];     /* timestamp, beacon interval, and
 193                                  * capability information)
 194                                  */
 195 } __packed;

rtw_survey_event_callback->rtw_find_network(&pmlmepriv->scanned_queue,  pnetwork->MacAddress);
struct wlan_bssid_ex *pnetwork;

> 
> thanks,
> 
> greg k-h
> 
> .
> 


      reply	other threads:[~2019-03-18 13:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-09  3:26 [PATCH net] staging: rtl8188eu: use is_zero_ether_addr() instead of memcmp() Mao Wenan
2019-03-12  6:29 ` maowenan
2019-03-12  6:35   ` Joe Perches
2019-03-12  6:58     ` maowenan
2019-03-12  7:06       ` Joe Perches
2019-03-12  7:14       ` Julia Lawall
2019-03-12 12:02   ` Greg KH
2019-03-17 11:26 ` Greg KH
2019-03-18 13:57   ` maowenan [this message]

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=eac0fbf3-c52c-fd76-06cf-5bd27f94b39f@huawei.com \
    --to=maowenan@huawei.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jananis37@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=straube.linux@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).