From: Doug Ledford <dledford@redhat.com>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>,
sean.hefty@intel.com, hal.rosenstock@gmail.com,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: julia.lawall@lip6.fr
Subject: Re: [PATCH] IB/core: Replace memset with eth_zero_addr
Date: Thu, 18 Feb 2016 12:31:50 -0500 [thread overview]
Message-ID: <56C60006.3090401@redhat.com> (raw)
In-Reply-To: <20160212074610.GA19134@amitoj-Inspiron-3542>
[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]
On 2/12/2016 2:46 AM, Amitoj Kaur Chawla wrote:
> Use eth_zero_addr to assign the zero address to the given address
> array instead of memset when second argument is address of zero.
>
> The Coccinelle semantic patch used to make this change is as follows:
>
> // <smpl>
> @eth_zero_addr@
> expression e;
> @@
>
> -memset(e,0x00,ETH_ALEN);
> +eth_zero_addr(e);
> // </smpl>
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Thanks, applied.
> ---
> drivers/infiniband/core/sa_query.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
> index f334090..4b3ac76 100644
> --- a/drivers/infiniband/core/sa_query.c
> +++ b/drivers/infiniband/core/sa_query.c
> @@ -1221,7 +1221,7 @@ static void ib_sa_path_rec_callback(struct ib_sa_query *sa_query,
> rec.net = NULL;
> rec.ifindex = 0;
> rec.gid_type = IB_GID_TYPE_IB;
> - memset(rec.dmac, 0, ETH_ALEN);
> + eth_zero_addr(rec.dmac);
> query->callback(status, &rec, query->context);
> } else
> query->callback(status, NULL, query->context);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
prev parent reply other threads:[~2016-02-18 17:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 7:46 [PATCH] IB/core: Replace memset with eth_zero_addr Amitoj Kaur Chawla
2016-02-18 17:31 ` Doug Ledford [this message]
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=56C60006.3090401@redhat.com \
--to=dledford@redhat.com \
--cc=amitoj1606@gmail.com \
--cc=hal.rosenstock@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sean.hefty@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox