From: Cyril Roelandt <tipecaml@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org,
Cyril Roelandt <tipecaml@gmail.com>,
rmody@brocade.com, netdev@vger.kernel.org
Subject: [PATCH 1/6] bna: remove useless calls to memset().
Date: Sun, 02 Dec 2012 02:40:17 +0000 [thread overview]
Message-ID: <1354416022-20189-2-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/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
WARNING: multiple messages have this Message-ID (diff)
From: Cyril Roelandt <tipecaml@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org,
Cyril Roelandt <tipecaml@gmail.com>,
rmody@brocade.com, netdev@vger.kernel.org
Subject: [PATCH 1/6] bna: remove useless calls to memset().
Date: Sun, 2 Dec 2012 03:40:17 +0100 [thread overview]
Message-ID: <1354416022-20189-2-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/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
next prev parent reply other threads:[~2012-12-02 2:40 UTC|newest]
Thread overview: 22+ 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 ` Cyril Roelandt
2012-12-02 2:40 ` Cyril Roelandt [this message]
2012-12-02 2:40 ` [PATCH 1/6] bna: remove " Cyril Roelandt
2012-12-03 1:33 ` David Miller
2012-12-03 1:33 ` David Miller
2012-12-02 2:40 ` [PATCH 2/6] scsi: bfa: " Cyril Roelandt
2012-12-02 2:40 ` 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:16 ` Bhanu Prakash Gollapudi
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-02 2:40 ` Cyril Roelandt
2012-12-03 22:27 ` adam radford
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 ` Cyril Roelandt
2012-12-03 3:09 ` Larry Finger
2012-12-03 3:09 ` Larry Finger
2012-12-02 2:40 ` [PATCH 6/6] vt6656: remove a useless call " Cyril Roelandt
2012-12-02 2:40 ` 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=1354416022-20189-2-git-send-email-tipecaml@gmail.com \
--to=tipecaml@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rmody@brocade.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.