linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6] scsi: bfa: remove useless calls to memset().
       [not found] <1354416022-20189-1-git-send-email-tipecaml@gmail.com>
@ 2012-12-02  2:40 ` Cyril Roelandt
  2012-12-02  2:40 ` [PATCH 3/6] scsi: bnx2fc: " Cyril Roelandt
  2012-12-02  2:40 ` [PATCH 4/6] scsi: megaraid: remove a useless call " Cyril Roelandt
  2 siblings, 0 replies; 5+ 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] 5+ messages in thread

* [PATCH 3/6] scsi: bnx2fc: remove useless calls to memset().
       [not found] <1354416022-20189-1-git-send-email-tipecaml@gmail.com>
  2012-12-02  2:40 ` [PATCH 2/6] scsi: bfa: remove useless calls to memset() 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 siblings, 1 reply; 5+ 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] 5+ messages in thread

* [PATCH 4/6] scsi: megaraid: remove a useless call to memset().
       [not found] <1354416022-20189-1-git-send-email-tipecaml@gmail.com>
  2012-12-02  2:40 ` [PATCH 2/6] scsi: bfa: remove useless calls to memset() Cyril Roelandt
  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
  2 siblings, 1 reply; 5+ 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] 5+ 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; 5+ 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] 5+ 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; 5+ 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] 5+ messages in thread

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1354416022-20189-1-git-send-email-tipecaml@gmail.com>
2012-12-02  2:40 ` [PATCH 2/6] scsi: bfa: remove useless calls to memset() 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

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