linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cyril Roelandt <tipecaml@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org,
	Cyril Roelandt <tipecaml@gmail.com>,
	JBottomley@parallels.com, linux-scsi@vger.kernel.org
Subject: [PATCH 2/6] scsi: bfa: remove useless calls to memset().
Date: Sun,  2 Dec 2012 03:40:18 +0100	[thread overview]
Message-ID: <1354416022-20189-3-git-send-email-tipecaml@gmail.com> (raw)
In-Reply-To: <1354416022-20189-1-git-send-email-tipecaml@gmail.com>

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


       reply	other threads:[~2012-12-02  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1354416022-20189-1-git-send-email-tipecaml@gmail.com>
2012-12-02  2:40 ` Cyril Roelandt [this message]
2012-12-02  2:40 ` [PATCH 3/6] scsi: bnx2fc: remove useless calls to memset() 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

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=1354416022-20189-3-git-send-email-tipecaml@gmail.com \
    --to=tipecaml@gmail.com \
    --cc=JBottomley@parallels.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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;
as well as URLs for NNTP newsgroup(s).