diff mbox

[v2] infiniband: mthca: Replace pci_pool_alloc by pci_pool_zalloc

Message ID 20161201184159.GA2949@jordon-HP-15-Notebook-PC (mailing list archive)
State Accepted
Headers show

Commit Message

Souptick Joarder Dec. 1, 2016, 6:41 p.m. UTC
In mthca_create_ah(), pci_pool_alloc() followed by memset will be
replaced by pci_pool_zalloc()

Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
---
v2:
  - Alignment changes
  - Remove empty lines

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

--
1.9.1

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

Comments

Yuval Shaia Dec. 1, 2016, 7:13 p.m. UTC | #1
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>

On Fri, Dec 02, 2016 at 12:11:59AM +0530, Souptick Joarder wrote:
> In mthca_create_ah(), pci_pool_alloc() followed by memset will be
> replaced by pci_pool_zalloc()
> 
> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
> ---
> v2:
>   - Alignment changes
>   - Remove empty lines
> 
>  drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c
> index bcac294..c9f0f36 100644
> --- a/drivers/infiniband/hw/mthca/mthca_av.c
> +++ b/drivers/infiniband/hw/mthca/mthca_av.c
> @@ -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 majordomo@vger.kernel.org
> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Souptick Joarder Dec. 5, 2016, 6:24 a.m. UTC | #2
Any further comment on this patch?

On Fri, Dec 2, 2016 at 12:43 AM, Yuval Shaia <yuval.shaia@oracle.com> wrote:
> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
>
> On Fri, Dec 02, 2016 at 12:11:59AM +0530, Souptick Joarder wrote:
>> In mthca_create_ah(), pci_pool_alloc() followed by memset will be
>> replaced by pci_pool_zalloc()
>>
>> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
>> ---
>> v2:
>>   - Alignment changes
>>   - Remove empty lines
>>
>>  drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c
>> index bcac294..c9f0f36 100644
>> --- a/drivers/infiniband/hw/mthca/mthca_av.c
>> +++ b/drivers/infiniband/hw/mthca/mthca_av.c
>> @@ -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 majordomo@vger.kernel.org
>> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Souptick Joarder Dec. 12, 2016, 4:45 a.m. UTC | #3
On Mon, Dec 5, 2016 at 11:54 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> Any further comment on this patch?
>
> On Fri, Dec 2, 2016 at 12:43 AM, Yuval Shaia <yuval.shaia@oracle.com> wrote:
>> Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
>>
>> On Fri, Dec 02, 2016 at 12:11:59AM +0530, Souptick Joarder wrote:
>>> In mthca_create_ah(), pci_pool_alloc() followed by memset will be
>>> replaced by pci_pool_zalloc()
>>>
>>> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
>>> ---
>>> v2:
>>>   - Alignment changes
>>>   - Remove empty lines
>>>
>>>  drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
>>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c
>>> index bcac294..c9f0f36 100644
>>> --- a/drivers/infiniband/hw/mthca/mthca_av.c
>>> +++ b/drivers/infiniband/hw/mthca/mthca_av.c
>>> @@ -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 majordomo@vger.kernel.org
>>> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford Dec. 14, 2016, 7:03 p.m. UTC | #4
On 12/1/2016 1:41 PM, Souptick Joarder wrote:
> In mthca_create_ah(), pci_pool_alloc() followed by memset will be
> replaced by pci_pool_zalloc()
> 
> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
> ---
> v2:
>   - Alignment changes
>   - Remove empty lines
> 
>  drivers/infiniband/hw/mthca/mthca_av.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mthca/mthca_av.c b/drivers/infiniband/hw/mthca/mthca_av.c
index bcac294..c9f0f36 100644
--- a/drivers/infiniband/hw/mthca/mthca_av.c
+++ b/drivers/infiniband/hw/mthca/mthca_av.c
@@ -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);