Skip to contentSkip to conversation

infiniband: mthca: Replace pci_pool_alloc by pci_pool_zalloc

PATCH Applied Souptick Joarder 3 participants 5 messages Dec 1, 2016 – Dec 14, 2016 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 infiniband: mthca: Replace pci_pool_alloc by pci_pool_zalloc

In mthca_create_ah(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc()

---
v2:
- Alignment changes
- Remove empty lines

 drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/hw/mthca/mthca_av.c +2 -4
index bcac294..c9f0f36 100644
@@ -186,8 +186,8 @@ int mthca_create_ah(struct mthca_dev *dev,
 
 on_hca_fail:
 	if (ah->type == MTHCA_AH_PCI_POOL) {
-		ah->av = pci_pool_alloc(dev->av_table.pool,
-					GFP_ATOMIC, &ah->avdma);
+		ah->av = pci_pool_zalloc(dev->av_table.pool,
+					 GFP_ATOMIC, &ah->avdma);
 		if (!ah->av)
 			return -ENOMEM;
 
@@ -196,8 +196,6 @@ int mthca_create_ah(struct mthca_dev *dev,
 
 	ah->key = pd->ntmr.ibmr.lkey;
 
-	memset(av, 0, MTHCA_AV_SIZE);
-
 	av->port_pd = cpu_to_be32(pd->pd_num | (ah_attr->port_num << 24));
 	av->g_slid  = ah_attr->src_path_bits;
 	av->dlid    = cpu_to_be16(ah_attr->dlid);

--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reviewed-by on v2 1/1
#1 lore raw
Quoted 39 lines · Souptick Joarder

In mthca_create_ah(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc()

---
v2:
- Alignment changes
- Remove empty lines

 drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/hw/mthca/mthca_av.c +2 -5
index bcac294..c9f0f36 100644
@@ -186,8 +186,8 @@ int mthca_create_ah(struct mthca_dev *dev,
 
 on_hca_fail:
 	if (ah->type == MTHCA_AH_PCI_POOL) {
-		ah->av = pci_pool_alloc(dev->av_table.pool,
-					GFP_ATOMIC, &ah->avdma);
+		ah->av = pci_pool_zalloc(dev->av_table.pool,
+					 GFP_ATOMIC, &ah->avdma);
 		if (!ah->av)
 			return -ENOMEM;
 
@@ -196,8 +196,6 @@ int mthca_create_ah(struct mthca_dev *dev,
 
 	ah->key = pd->ntmr.ibmr.lkey;
 
-	memset(av, 0, MTHCA_AV_SIZE);
-
 	av->port_pd = cpu_to_be32(pd->pd_num | (ah_attr->port_num << 24));
 	av->g_slid  = ah_attr->src_path_bits;
 	av->dlid    = cpu_to_be16(ah_attr->dlid);
--

1.9.1

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Any further comment on this patch?

Quoted 42 lines · Yuval Shaia
Quoted 39 lines · Souptick Joarder

In mthca_create_ah(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc()

---
v2:
- Alignment changes
- Remove empty lines

 drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/hw/mthca/mthca_av.c +2 -5
index bcac294..c9f0f36 100644
@@ -186,8 +186,8 @@ int mthca_create_ah(struct mthca_dev *dev,
 
 on_hca_fail:
      if (ah->type == MTHCA_AH_PCI_POOL) {
-             ah->av = pci_pool_alloc(dev->av_table.pool,
-                                     GFP_ATOMIC, &ah->avdma);
+             ah->av = pci_pool_zalloc(dev->av_table.pool,
+                                      GFP_ATOMIC, &ah->avdma);
              if (!ah->av)
                      return -ENOMEM;
 
@@ -196,8 +196,6 @@ int mthca_create_ah(struct mthca_dev *dev,
 
      ah->key = pd->ntmr.ibmr.lkey;
 
-     memset(av, 0, MTHCA_AV_SIZE);
-
      av->port_pd = cpu_to_be32(pd->pd_num | (ah_attr->port_num << 24));
      av->g_slid  = ah_attr->src_path_bits;
      av->dlid    = cpu_to_be16(ah_attr->dlid);
--

1.9.1

Quoted 4 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAFqt6zarZHK3+7QH3tfuHXr2YtV_bL8WavKuPt97+YaqQoB=1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 45 lines · Souptick Joarder

Any further comment on this patch?

Quoted 42 lines · Yuval Shaia
Quoted 39 lines · Souptick Joarder

In mthca_create_ah(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc()

---
v2:
- Alignment changes
- Remove empty lines

 drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/infiniband/hw/mthca/mthca_av.c +2 -5
index bcac294..c9f0f36 100644
@@ -186,8 +186,8 @@ int mthca_create_ah(struct mthca_dev *dev,
 
 on_hca_fail:
      if (ah->type == MTHCA_AH_PCI_POOL) {
-             ah->av = pci_pool_alloc(dev->av_table.pool,
-                                     GFP_ATOMIC, &ah->avdma);
+             ah->av = pci_pool_zalloc(dev->av_table.pool,
+                                      GFP_ATOMIC, &ah->avdma);
              if (!ah->av)
                      return -ENOMEM;
 
@@ -196,8 +196,6 @@ int mthca_create_ah(struct mthca_dev *dev,
 
      ah->key = pd->ntmr.ibmr.lkey;
 
-     memset(av, 0, MTHCA_AV_SIZE);
-
      av->port_pd = cpu_to_be32(pd->pd_num | (ah_attr->port_num << 24));
      av->g_slid  = ah_attr->src_path_bits;
      av->dlid    = cpu_to_be16(ah_attr->dlid);
--

1.9.1

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Any comment on this patch?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#5 lore raw
In reply to Souptick Joarder
Quoted 11 lines · Souptick Joarder

In mthca_create_ah(), pci_pool_alloc() followed by memset will be replaced by pci_pool_zalloc()

---
v2:
- Alignment changes
- Remove empty lines

 drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Thanks, applied.

Signature · 2 lines
Doug Ledford <[email protected]>
    GPG Key ID: 0E572FDD