Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1312272 > unrolled thread
| Started by | Lucas Tanure <tanure@linux.com> |
|---|---|
| First post | 2016-01-19 15:10 +0100 |
| Last post | 2016-01-19 21:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] infiniband: Replace memset with eth_zero_addr Lucas Tanure <tanure@linux.com> - 2016-01-19 15:10 +0100
Re: [PATCH] infiniband: Replace memset with eth_zero_addr Doug Ledford <dledford@redhat.com> - 2016-01-19 21:50 +0100
| From | Lucas Tanure <tanure@linux.com> |
|---|---|
| Date | 2016-01-19 15:10 +0100 |
| Subject | [PATCH] infiniband: Replace memset with eth_zero_addr |
| Message-ID | <qSF8U-w0-41@gated-at.bofh.it> |
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@linux.com>
---
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
[toc] | [next] | [standalone]
| From | Doug Ledford <dledford@redhat.com> |
|---|---|
| Date | 2016-01-19 21:50 +0100 |
| Message-ID | <qSLnY-4xA-5@gated-at.bofh.it> |
| In reply to | #1312272 |
[Multipart message — attachments visible in raw view] — view raw
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@linux.com>
> ---
> 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@redhat.com>
GPG KeyID: 0E572FDD
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web