kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Remove useless calls to memset().
@ 2012-12-02  2:40 Cyril Roelandt
  2012-12-02  2:40 ` [PATCH 1/6] bna: remove " Cyril Roelandt
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Cyril Roelandt @ 2012-12-02  2:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors, Cyril Roelandt

The following six patches remove useless calls to memset(). They have been found
with this Coccinelle script:

<spml>
@@
expression E;
expression S;
@@
-memset(E, 0, S);
 memcpy(E, ..., S);
</spml>

They have only been tested by compilation.

WBR,
Cyril Roelandt.


Cyril Roelandt (6):
  bna: remove useless calls to memset().
  scsi: bfa: remove useless calls to memset().
  scsi: bnx2fc: remove useless calls to memset().
  scsi: megaraid: remove a useless call to memset().
  rtl8712: remove useless calls to memset().
  vt6656: remove a useless call to memset().

 drivers/net/ethernet/brocade/bna/bfa_ioc.c  |    4 ----
 drivers/scsi/bfa/bfa_ioc.c                  |    1 -
 drivers/scsi/bfa/bfad_bsg.c                 |    1 -
 drivers/scsi/bnx2fc/bnx2fc_hwi.c            |    4 ----
 drivers/scsi/megaraid/megaraid_sas_fusion.c |    2 --
 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 -----
 drivers/staging/vt6656/bssdb.c              |    1 -
 10 files changed, 23 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/6] bna: remove useless calls to memset().
  2012-12-02  2:40 [PATCH 0/6] Remove useless calls to memset() Cyril Roelandt
@ 2012-12-02  2:40 ` Cyril Roelandt
  2012-12-03  1:33   ` David Miller
  2012-12-02  2:40 ` [PATCH 2/6] scsi: bfa: " Cyril Roelandt
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Cyril Roelandt @ 2012-12-02  2:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors, Cyril Roelandt, rmody, netdev

These calls are followed by calls to memcpy() on the same memory area, so they
can safely be removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 drivers/net/ethernet/brocade/bna/bfa_ioc.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c
index 959c58e..3227fdd 100644
--- a/drivers/net/ethernet/brocade/bna/bfa_ioc.c
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.c
@@ -2273,7 +2273,6 @@ bfa_ioc_get_type(struct bfa_ioc *ioc)
 static void
 bfa_ioc_get_adapter_serial_num(struct bfa_ioc *ioc, char *serial_num)
 {
-	memset(serial_num, 0, BFA_ADAPTER_SERIAL_NUM_LEN);
 	memcpy(serial_num,
 			(void *)ioc->attr->brcd_serialnum,
 			BFA_ADAPTER_SERIAL_NUM_LEN);
@@ -2282,7 +2281,6 @@ bfa_ioc_get_adapter_serial_num(struct bfa_ioc *ioc, char *serial_num)
 static void
 bfa_ioc_get_adapter_fw_ver(struct bfa_ioc *ioc, char *fw_ver)
 {
-	memset(fw_ver, 0, BFA_VERSION_LEN);
 	memcpy(fw_ver, ioc->attr->fw_version, BFA_VERSION_LEN);
 }
 
@@ -2304,7 +2302,6 @@ bfa_ioc_get_pci_chip_rev(struct bfa_ioc *ioc, char *chip_rev)
 static void
 bfa_ioc_get_adapter_optrom_ver(struct bfa_ioc *ioc, char *optrom_ver)
 {
-	memset(optrom_ver, 0, BFA_VERSION_LEN);
 	memcpy(optrom_ver, ioc->attr->optrom_version,
 		      BFA_VERSION_LEN);
 }
@@ -2312,7 +2309,6 @@ bfa_ioc_get_adapter_optrom_ver(struct bfa_ioc *ioc, char *optrom_ver)
 static void
 bfa_ioc_get_adapter_manufacturer(struct bfa_ioc *ioc, char *manufacturer)
 {
-	memset(manufacturer, 0, BFA_ADAPTER_MFG_NAME_LEN);
 	memcpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN);
 }
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/6] scsi: bfa: remove useless calls to memset().
  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-02  2:40 ` Cyril Roelandt
  2012-12-02  2:40 ` [PATCH 3/6] scsi: bnx2fc: " Cyril Roelandt
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Cyril Roelandt @ 2012-12-02  2:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors, Cyril Roelandt, JBottomley, linux-scsi

These calls are followed by calls to memcpy() on the same memory area, so they
can safely be removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 drivers/scsi/bfa/bfa_ioc.c  |    1 -
 drivers/scsi/bfa/bfad_bsg.c |    1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 0116c10..dd2a2ef 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -2517,7 +2517,6 @@ bfa_ioc_get_type(struct bfa_ioc_s *ioc)
 void
 bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num)
 {
-	memset((void *)serial_num, 0, BFA_ADAPTER_SERIAL_NUM_LEN);
 	memcpy((void *)serial_num,
 			(void *)ioc->attr->brcd_serialnum,
 			BFA_ADAPTER_SERIAL_NUM_LEN);
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c
index 555e7db..9527fdb 100644
--- a/drivers/scsi/bfa/bfad_bsg.c
+++ b/drivers/scsi/bfa/bfad_bsg.c
@@ -3197,7 +3197,6 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf,
 		goto out_free_mem;
 
 	/* copy the linear bsg buffer to buf_info */
-	memset(buf_info->virt, 0, buf_info->size);
 	memcpy(buf_info->virt, payload_kbuf, buf_info->size);
 
 	/*
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/6] scsi: bnx2fc: remove useless calls to memset().
  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-02  2:40 ` [PATCH 2/6] scsi: bfa: " Cyril Roelandt
@ 2012-12-02  2:40 ` 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
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Cyril Roelandt @ 2012-12-02  2:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-janitors, Cyril Roelandt, bprakash, JBottomley, linux-scsi

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/scsi/bnx2fc/bnx2fc_hwi.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
index ef60afa..9be42b8 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
@@ -759,8 +759,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
 		case FCOE_ERROR_CODE_DATA_SOFN_SEQ_ACTIVE_RESET:
 			BNX2FC_TGT_DBG(tgt, "REC TOV popped for xid - 0x%x\n",
 				   xid);
-			memset(&io_req->err_entry, 0,
-			       sizeof(struct fcoe_err_report_entry));
 			memcpy(&io_req->err_entry, err_entry,
 			       sizeof(struct fcoe_err_report_entry));
 			if (!test_bit(BNX2FC_FLAG_SRR_SENT,
@@ -847,8 +845,6 @@ ret_err_rqe:
 			goto ret_warn_rqe;
 		}
 
-		memset(&io_req->err_entry, 0,
-		       sizeof(struct fcoe_err_report_entry));
 		memcpy(&io_req->err_entry, err_entry,
 		       sizeof(struct fcoe_err_report_entry));
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/6] scsi: megaraid: remove a useless call to memset().
  2012-12-02  2:40 [PATCH 0/6] Remove useless calls to memset() Cyril Roelandt
                   ` (2 preceding siblings ...)
  2012-12-02  2:40 ` [PATCH 3/6] scsi: bnx2fc: " Cyril Roelandt
@ 2012-12-02  2:40 ` 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-02  2:40 ` [PATCH 6/6] vt6656: remove a useless call " Cyril Roelandt
  5 siblings, 1 reply; 11+ messages in thread
From: Cyril Roelandt @ 2012-12-02  2:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-janitors, Cyril Roelandt, megaraidlinux, JBottomley,
	linux-scsi

This call is followed by a call to memcpy() on the same memory area, so it can
be safely removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 74030af..71cc3eb 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1028,8 +1028,6 @@ map_cmd_status(struct megasas_cmd_fusion *cmd, u8 status, u8 ext_status)
 
 		cmd->scmd->result = (DID_OK << 16) | ext_status;
 		if (ext_status = SAM_STAT_CHECK_CONDITION) {
-			memset(cmd->scmd->sense_buffer, 0,
-			       SCSI_SENSE_BUFFERSIZE);
 			memcpy(cmd->scmd->sense_buffer, cmd->sense,
 			       SCSI_SENSE_BUFFERSIZE);
 			cmd->scmd->result |= DRIVER_SENSE << 24;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/6] rtl8712: remove useless calls to memset().
  2012-12-02  2:40 [PATCH 0/6] Remove useless calls to memset() Cyril Roelandt
                   ` (3 preceding siblings ...)
  2012-12-02  2:40 ` [PATCH 4/6] scsi: megaraid: remove a useless call " Cyril Roelandt
@ 2012-12-02  2:40 ` Cyril Roelandt
  2012-12-03  3:09   ` Larry Finger
  2012-12-02  2:40 ` [PATCH 6/6] vt6656: remove a useless call " Cyril Roelandt
  5 siblings, 1 reply; 11+ messages in thread
From: Cyril Roelandt @ 2012-12-02  2:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-janitors, Cyril Roelandt, Larry.Finger,
	florian.c.schilhabel, gregkh, paul.gortmaker, dan.carpenter,
	yongjun_wei, justinmattock, devel

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(-)

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));
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/6] vt6656: remove a useless call to memset().
  2012-12-02  2:40 [PATCH 0/6] Remove useless calls to memset() Cyril Roelandt
                   ` (4 preceding siblings ...)
  2012-12-02  2:40 ` [PATCH 5/6] rtl8712: remove useless calls " Cyril Roelandt
@ 2012-12-02  2:40 ` Cyril Roelandt
  5 siblings, 0 replies; 11+ messages in thread
From: Cyril Roelandt @ 2012-12-02  2:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-janitors, Cyril Roelandt, forest, gregkh, tvboxspy,
	marcos.souza.org, standby24x7, justinmattock, devel

This call is followed by a call to memcpy() on the same memory area, so it can
be safely removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 drivers/staging/vt6656/bssdb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c
index 6a13941..f9098b8 100644
--- a/drivers/staging/vt6656/bssdb.c
+++ b/drivers/staging/vt6656/bssdb.c
@@ -240,7 +240,6 @@ pDevice->bSameBSSMaxNum = jj;
             pSelect->bSelected = TRUE;
                         if (pDevice->bRoaming = FALSE)  {
 	//       Einsn Add @20070907
-				memset(pbyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
 			memcpy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ;
                                                 }
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/6] bna: remove useless calls to memset().
  2012-12-02  2:40 ` [PATCH 1/6] bna: remove " Cyril Roelandt
@ 2012-12-03  1:33   ` David Miller
  0 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2012-12-03  1:33 UTC (permalink / raw)
  To: tipecaml; +Cc: linux-kernel, kernel-janitors, rmody, netdev

From: Cyril Roelandt <tipecaml@gmail.com>
Date: Sun,  2 Dec 2012 03:40:17 +0100

> These calls are followed by calls to memcpy() on the same memory area, so they
> can safely be removed.
> 
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/6] rtl8712: remove useless calls to memset().
  2012-12-02  2:40 ` [PATCH 5/6] rtl8712: remove useless calls " Cyril Roelandt
@ 2012-12-03  3:09   ` Larry Finger
  0 siblings, 0 replies; 11+ messages in thread
From: Larry Finger @ 2012-12-03  3:09 UTC (permalink / raw)
  To: Cyril Roelandt
  Cc: linux-kernel, kernel-janitors, florian.c.schilhabel, gregkh,
	paul.gortmaker, dan.carpenter, yongjun_wei, justinmattock, devel

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));
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/6] scsi: bnx2fc: remove useless calls to memset().
  2012-12-02  2:40 ` [PATCH 3/6] scsi: bnx2fc: " Cyril Roelandt
@ 2012-12-03 22:16   ` Bhanu Prakash Gollapudi
  0 siblings, 0 replies; 11+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-12-03 22:16 UTC (permalink / raw)
  To: Cyril Roelandt; +Cc: linux-kernel, kernel-janitors, JBottomley, linux-scsi

On 12/01/2012 06: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/scsi/bnx2fc/bnx2fc_hwi.c |    4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
> index ef60afa..9be42b8 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
> @@ -759,8 +759,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
>   		case FCOE_ERROR_CODE_DATA_SOFN_SEQ_ACTIVE_RESET:
>   			BNX2FC_TGT_DBG(tgt, "REC TOV popped for xid - 0x%x\n",
>   				   xid);
> -			memset(&io_req->err_entry, 0,
> -			       sizeof(struct fcoe_err_report_entry));
>   			memcpy(&io_req->err_entry, err_entry,
>   			       sizeof(struct fcoe_err_report_entry));
>   			if (!test_bit(BNX2FC_FLAG_SRR_SENT,
> @@ -847,8 +845,6 @@ ret_err_rqe:
>   			goto ret_warn_rqe;
>   		}
>   
> -		memset(&io_req->err_entry, 0,
> -		       sizeof(struct fcoe_err_report_entry));
>   		memcpy(&io_req->err_entry, err_entry,
>   		       sizeof(struct fcoe_err_report_entry));
>   
Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/6] scsi: megaraid: remove a useless call to memset().
  2012-12-02  2:40 ` [PATCH 4/6] scsi: megaraid: remove a useless call " Cyril Roelandt
@ 2012-12-03 22:27   ` adam radford
  0 siblings, 0 replies; 11+ messages in thread
From: adam radford @ 2012-12-03 22:27 UTC (permalink / raw)
  To: Cyril Roelandt
  Cc: linux-kernel, kernel-janitors, megaraidlinux, JBottomley,
	linux-scsi

On Sat, Dec 1, 2012 at 6:40 PM, Cyril Roelandt <tipecaml@gmail.com> wrote:
> This call is followed by a call to memcpy() on the same memory area, so it can
> be safely removed.
>
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_fusion.c |    2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> index 74030af..71cc3eb 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> @@ -1028,8 +1028,6 @@ map_cmd_status(struct megasas_cmd_fusion *cmd, u8 status, u8 ext_status)
>
>                 cmd->scmd->result = (DID_OK << 16) | ext_status;
>                 if (ext_status = SAM_STAT_CHECK_CONDITION) {
> -                       memset(cmd->scmd->sense_buffer, 0,
> -                              SCSI_SENSE_BUFFERSIZE);
>                         memcpy(cmd->scmd->sense_buffer, cmd->sense,
>                                SCSI_SENSE_BUFFERSIZE);
>                         cmd->scmd->result |= DRIVER_SENSE << 24;
> --

Acked-by: Adam Radford <aradford@gmail.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-12-03 22:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-12-02  2:40 ` [PATCH 6/6] vt6656: remove a useless call " Cyril Roelandt

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).