linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] infiniband: Replace memset with eth_zero_addr
@ 2016-01-19 14:06 Lucas Tanure
       [not found] ` <1453212390-6478-1-git-send-email-tanure-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Tanure @ 2016-01-19 14:06 UTC (permalink / raw)
  To: Yishai Hadas, Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Use eth_zero_addr to assign the zero address to the given address
array instead of memset when second argument is address of zero.

Signed-off-by: Lucas Tanure <tanure-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/ah.c       | 2 +-
 drivers/infiniband/hw/nes/nes_utils.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
index 86af713..44d4164 100644
--- a/drivers/infiniband/hw/mlx4/ah.c
+++ b/drivers/infiniband/hw/mlx4/ah.c
@@ -92,7 +92,7 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
 				ah_attr->grh.sgid_index, &sgid, &gid_attr);
 	if (ret)
 		return ERR_PTR(ret);
-	memset(ah->av.eth.s_mac, 0, ETH_ALEN);
+	eth_zero_addr(ah->av.eth.s_mac);
 	if (gid_attr.ndev) {
 		if (is_vlan_dev(gid_attr.ndev))
 			vlan_tag = vlan_dev_vlan_id(gid_attr.ndev);
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index 2042c0f..6d3a169 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -727,7 +727,7 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
 	if (action == NES_ARP_DELETE) {
 		nes_debug(NES_DBG_NETDEV, "DELETE, arp_index=%d\n", arp_index);
 		nesadapter->arp_table[arp_index].ip_addr = 0;
-		memset(nesadapter->arp_table[arp_index].mac_addr, 0x00, ETH_ALEN);
+		eth_zero_addr(nesadapter->arp_table[arp_index].mac_addr);
 		nes_free_resource(nesadapter, nesadapter->allocated_arps, arp_index);
 		return arp_index;
 	}
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] infiniband: Replace memset with eth_zero_addr
       [not found] ` <1453212390-6478-1-git-send-email-tanure-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
@ 2016-01-19 20:44   ` Doug Ledford
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2016-01-19 20:44 UTC (permalink / raw)
  To: Lucas Tanure, Yishai Hadas
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]

On 01/19/2016 09:06 AM, Lucas Tanure 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.
> 
> Signed-off-by: Lucas Tanure <tanure-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx4/ah.c       | 2 +-
>  drivers/infiniband/hw/nes/nes_utils.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
> index 86af713..44d4164 100644
> --- a/drivers/infiniband/hw/mlx4/ah.c
> +++ b/drivers/infiniband/hw/mlx4/ah.c
> @@ -92,7 +92,7 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
>  				ah_attr->grh.sgid_index, &sgid, &gid_attr);
>  	if (ret)
>  		return ERR_PTR(ret);
> -	memset(ah->av.eth.s_mac, 0, ETH_ALEN);
> +	eth_zero_addr(ah->av.eth.s_mac);
>  	if (gid_attr.ndev) {
>  		if (is_vlan_dev(gid_attr.ndev))
>  			vlan_tag = vlan_dev_vlan_id(gid_attr.ndev);
> diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
> index 2042c0f..6d3a169 100644
> --- a/drivers/infiniband/hw/nes/nes_utils.c
> +++ b/drivers/infiniband/hw/nes/nes_utils.c
> @@ -727,7 +727,7 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
>  	if (action == NES_ARP_DELETE) {
>  		nes_debug(NES_DBG_NETDEV, "DELETE, arp_index=%d\n", arp_index);
>  		nesadapter->arp_table[arp_index].ip_addr = 0;
> -		memset(nesadapter->arp_table[arp_index].mac_addr, 0x00, ETH_ALEN);
> +		eth_zero_addr(nesadapter->arp_table[arp_index].mac_addr);
>  		nes_free_resource(nesadapter, nesadapter->allocated_arps, arp_index);
>  		return arp_index;
>  	}
> 

Thanks, applied.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-19 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-19 14:06 [PATCH] infiniband: Replace memset with eth_zero_addr Lucas Tanure
     [not found] ` <1453212390-6478-1-git-send-email-tanure-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
2016-01-19 20:44   ` Doug Ledford

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