public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Cyril Roelandt <tipecaml@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	florian.c.schilhabel@googlemail.com, gregkh@linuxfoundation.org,
	paul.gortmaker@windriver.com, dan.carpenter@oracle.com,
	yongjun_wei@trendmicro.com.cn, justinmattock@gmail.com,
	devel@driverdev.osuosl.org
Subject: Re: [PATCH 5/6] rtl8712: remove useless calls to memset().
Date: Sun, 02 Dec 2012 21:09:59 -0600	[thread overview]
Message-ID: <50BC1807.3050305@lwfinger.net> (raw)
In-Reply-To: <1354416022-20189-6-git-send-email-tipecaml@gmail.com>

On 12/01/2012 08:40 PM, Cyril Roelandt wrote:
> These calls are followed by calls to memcpy() on the same memory area, so they
> can be safely removed.
>
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> ---
>   drivers/staging/rtl8712/mlme_linux.c        |    2 --
>   drivers/staging/rtl8712/rtl871x_cmd.c       |    1 -
>   drivers/staging/rtl8712/rtl871x_ioctl_set.c |    2 --
>   drivers/staging/rtl8712/rtl871x_mlme.c      |    5 -----
>   4 files changed, 10 deletions(-)

Acked-by: Larry Finger <Larry.Finger@lwfinger.net> (for r8712u)

Thanks,

Larry

>
> diff --git a/drivers/staging/rtl8712/mlme_linux.c b/drivers/staging/rtl8712/mlme_linux.c
> index 7279854..f569a70 100644
> --- a/drivers/staging/rtl8712/mlme_linux.c
> +++ b/drivers/staging/rtl8712/mlme_linux.c
> @@ -106,8 +106,6 @@ void r8712_os_indicate_disconnect(struct _adapter *adapter)
>   		 * disconnect with AP for 60 seconds.
>   		 */
>
> -		memset(&backupPMKIDList[0], 0x00, sizeof(
> -			struct RT_PMKID_LIST) *	NUM_PMKID_CACHE);
>   		memcpy(&backupPMKIDList[0], &adapter->securitypriv.
>   			PMKIDList[0], sizeof(struct RT_PMKID_LIST) *
>   			NUM_PMKID_CACHE);
> diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c
> index 31f31dbf..f16307f 100644
> --- a/drivers/staging/rtl8712/rtl871x_cmd.c
> +++ b/drivers/staging/rtl8712/rtl871x_cmd.c
> @@ -525,7 +525,6 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
>   		kfree(pcmd);
>   		return _FAIL;
>   	}
> -	memset(psecnetwork, 0, t_len);
>   	memcpy(psecnetwork, &pnetwork->network, t_len);
>   	auth = &psecuritypriv->authenticator_ie[0];
>   	psecuritypriv->authenticator_ie[0] = (unsigned char)
> diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
> index d3ab24e..53a7c8c 100644
> --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c
> +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
> @@ -97,8 +97,6 @@ static u8 do_join(struct _adapter *padapter)
>   				pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
>   				pibss = padapter->registrypriv.dev_network.
>   					MacAddress;
> -				memset(&pdev_network->Ssid, 0,
> -					sizeof(struct ndis_802_11_ssid));
>   				memcpy(&pdev_network->Ssid,
>   					&pmlmepriv->assoc_ssid,
>   					sizeof(struct ndis_802_11_ssid));
> diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
> index c51ad9e..e52f04d 100644
> --- a/drivers/staging/rtl8712/rtl871x_mlme.c
> +++ b/drivers/staging/rtl8712/rtl871x_mlme.c
> @@ -604,9 +604,6 @@ void r8712_surveydone_event_callback(struct _adapter *adapter, u8 *pbuf)
>   						 adapter->registrypriv.
>   							dev_network.MacAddress;
>   					pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;
> -					memset(&pdev_network->Ssid, 0,
> -						sizeof(struct
> -						       ndis_802_11_ssid));
>   					memcpy(&pdev_network->Ssid,
>   						&pmlmepriv->assoc_ssid,
>   						sizeof(struct
> @@ -1006,8 +1003,6 @@ void r8712_stadel_event_callback(struct _adapter *adapter, u8 *pbuf)
>   			memcpy(pdev_network, &tgt_network->network,
>   				r8712_get_ndis_wlan_bssid_ex_sz(&tgt_network->
>   							network));
> -			memset(&pdev_network->Ssid, 0,
> -				sizeof(struct ndis_802_11_ssid));
>   			memcpy(&pdev_network->Ssid,
>   				&pmlmepriv->assoc_ssid,
>   				sizeof(struct ndis_802_11_ssid));
>


  reply	other threads:[~2012-12-03  3:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-02  2:40 [PATCH 0/6] Remove useless calls to memset() Cyril Roelandt
2012-12-02  2:40 ` [PATCH 1/6] bna: remove " Cyril Roelandt
2012-12-03  1:33   ` David Miller
2012-12-02  2:40 ` [PATCH 2/6] scsi: bfa: " Cyril Roelandt
2012-12-02  2:40 ` [PATCH 3/6] scsi: bnx2fc: " Cyril Roelandt
2012-12-03 22:16   ` Bhanu Prakash Gollapudi
2012-12-02  2:40 ` [PATCH 4/6] scsi: megaraid: remove a useless call " Cyril Roelandt
2012-12-03 22:27   ` adam radford
2012-12-02  2:40 ` [PATCH 5/6] rtl8712: remove useless calls " Cyril Roelandt
2012-12-03  3:09   ` Larry Finger [this message]
2012-12-02  2:40 ` [PATCH 6/6] vt6656: remove a useless call " Cyril Roelandt

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=50BC1807.3050305@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=florian.c.schilhabel@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=justinmattock@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=tipecaml@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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