Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/core: Replace memset with eth_zero_addr

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>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Amitoj Kaur Chawla and committed by
Doug Ledford
db9314cd eaebc7d2

+1 -1
+1 -1
drivers/infiniband/core/sa_query.c
··· 1221 1221 rec.net = NULL; 1222 1222 rec.ifindex = 0; 1223 1223 rec.gid_type = IB_GID_TYPE_IB; 1224 - memset(rec.dmac, 0, ETH_ALEN); 1224 + eth_zero_addr(rec.dmac); 1225 1225 query->callback(status, &rec, query->context); 1226 1226 } else 1227 1227 query->callback(status, NULL, query->context);