linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qla4xxx: Use dma_pool_zalloc
@ 2016-12-06 20:23 Souptick Joarder
  2016-12-12  4:46 ` Souptick Joarder
  0 siblings, 1 reply; 6+ messages in thread
From: Souptick Joarder @ 2016-12-06 20:23 UTC (permalink / raw)
  To: QLogic-Storage-Upstream; +Cc: linux-scsi

We should use dma_pool_zalloc instead of dma_pool_alloc/memset

Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
---
 drivers/scsi/qla4xxx/ql4_mbx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index c291fdf..f2edfd7 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1587,12 +1587,11 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password,
 	struct ql4_chap_table *chap_table;
 	dma_addr_t chap_dma;

-	chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
+	chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
 	if (chap_table == NULL)
 		return -ENOMEM;

 	chap_size = sizeof(struct ql4_chap_table);
-	memset(chap_table, 0, chap_size);

 	if (is_qla40XX(ha))
 		offset = FLASH_CHAP_OFFSET | (idx * chap_size);
--
1.9.1


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

* Re: [PATCH] scsi: qla4xxx: Use dma_pool_zalloc
  2016-12-06 20:23 [PATCH] scsi: qla4xxx: Use dma_pool_zalloc Souptick Joarder
@ 2016-12-12  4:46 ` Souptick Joarder
  2016-12-13 10:41   ` Javali, Nilesh
  0 siblings, 1 reply; 6+ messages in thread
From: Souptick Joarder @ 2016-12-12  4:46 UTC (permalink / raw)
  To: QLogic-Storage-Upstream; +Cc: linux-scsi

On Wed, Dec 7, 2016 at 1:53 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> We should use dma_pool_zalloc instead of dma_pool_alloc/memset
>
> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
> ---
>  drivers/scsi/qla4xxx/ql4_mbx.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
> index c291fdf..f2edfd7 100644
> --- a/drivers/scsi/qla4xxx/ql4_mbx.c
> +++ b/drivers/scsi/qla4xxx/ql4_mbx.c
> @@ -1587,12 +1587,11 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password,
>         struct ql4_chap_table *chap_table;
>         dma_addr_t chap_dma;
>
> -       chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
> +       chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
>         if (chap_table == NULL)
>                 return -ENOMEM;
>
>         chap_size = sizeof(struct ql4_chap_table);
> -       memset(chap_table, 0, chap_size);
>
>         if (is_qla40XX(ha))
>                 offset = FLASH_CHAP_OFFSET | (idx * chap_size);
> --
> 1.9.1
>

Any comment on this patch?

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

* Re: [PATCH] scsi: qla4xxx: Use dma_pool_zalloc
  2016-12-12  4:46 ` Souptick Joarder
@ 2016-12-13 10:41   ` Javali, Nilesh
  2016-12-13 13:05     ` Souptick Joarder
  0 siblings, 1 reply; 6+ messages in thread
From: Javali, Nilesh @ 2016-12-13 10:41 UTC (permalink / raw)
  To: Souptick Joarder, QLogic-Storage-Upstream@qlogic.com
  Cc: linux-scsi@vger.kernel.org



On 12/12/16, 10:16 AM, "linux-scsi-owner@vger.kernel.org on behalf of
Souptick Joarder" <linux-scsi-owner@vger.kernel.org on behalf of
jrdr.linux@gmail.com> wrote:

>On Wed, Dec 7, 2016 at 1:53 AM, Souptick Joarder <jrdr.linux@gmail.com>
>wrote:
>> We should use dma_pool_zalloc instead of dma_pool_alloc/memset
>>
>> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
>> ---
>>  drivers/scsi/qla4xxx/ql4_mbx.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c
>>b/drivers/scsi/qla4xxx/ql4_mbx.c
>> index c291fdf..f2edfd7 100644
>> --- a/drivers/scsi/qla4xxx/ql4_mbx.c
>> +++ b/drivers/scsi/qla4xxx/ql4_mbx.c
>> @@ -1587,12 +1587,11 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha,
>>char *username, char *password,
>>         struct ql4_chap_table *chap_table;
>>         dma_addr_t chap_dma;
>>
>> -       chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL,
>>&chap_dma);
>> +       chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL,
>>&chap_dma);
>>         if (chap_table == NULL)
>>                 return -ENOMEM;
>>
>>         chap_size = sizeof(struct ql4_chap_table);
>> -       memset(chap_table, 0, chap_size);
>>
>>         if (is_qla40XX(ha))
>>                 offset = FLASH_CHAP_OFFSET | (idx * chap_size);
>> --
>> 1.9.1
>>
>
>Any comment on this patch?

There are multiple other places where dma_pool_alloc needs to be replaced
by dma_pool_zalloc.

Can you please take care within a single patch.

Thanks,
Nilesh


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

* Re: [PATCH] scsi: qla4xxx: Use dma_pool_zalloc
  2016-12-13 10:41   ` Javali, Nilesh
@ 2016-12-13 13:05     ` Souptick Joarder
  2016-12-21 11:43       ` Javali, Nilesh
  0 siblings, 1 reply; 6+ messages in thread
From: Souptick Joarder @ 2016-12-13 13:05 UTC (permalink / raw)
  To: Javali, Nilesh
  Cc: QLogic-Storage-Upstream@qlogic.com, linux-scsi@vger.kernel.org

On Tue, Dec 13, 2016 at 4:11 PM, Javali, Nilesh
<Nilesh.Javali@cavium.com> wrote:
>
>
> On 12/12/16, 10:16 AM, "linux-scsi-owner@vger.kernel.org on behalf of
> Souptick Joarder" <linux-scsi-owner@vger.kernel.org on behalf of
> jrdr.linux@gmail.com> wrote:
>
>>On Wed, Dec 7, 2016 at 1:53 AM, Souptick Joarder <jrdr.linux@gmail.com>
>>wrote:
>>> We should use dma_pool_zalloc instead of dma_pool_alloc/memset
>>>
>>> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
>>> ---
>>>  drivers/scsi/qla4xxx/ql4_mbx.c | 3 +--
>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c
>>>b/drivers/scsi/qla4xxx/ql4_mbx.c
>>> index c291fdf..f2edfd7 100644
>>> --- a/drivers/scsi/qla4xxx/ql4_mbx.c
>>> +++ b/drivers/scsi/qla4xxx/ql4_mbx.c
>>> @@ -1587,12 +1587,11 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha,
>>>char *username, char *password,
>>>         struct ql4_chap_table *chap_table;
>>>         dma_addr_t chap_dma;
>>>
>>> -       chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL,
>>>&chap_dma);
>>> +       chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL,
>>>&chap_dma);
>>>         if (chap_table == NULL)
>>>                 return -ENOMEM;
>>>
>>>         chap_size = sizeof(struct ql4_chap_table);
>>> -       memset(chap_table, 0, chap_size);
>>>
>>>         if (is_qla40XX(ha))
>>>                 offset = FLASH_CHAP_OFFSET | (idx * chap_size);
>>> --
>>> 1.9.1
>>>
>>
>>Any comment on this patch?
>
> There are multiple other places where dma_pool_alloc needs to be replaced
> by dma_pool_zalloc.


 are you asking to do this for SCSI subsystem?
 If yes, I can do that.

>
> Can you please take care within a single patch.

 But the same changes are applicable in other subsystems as well.
 I think I shouldn't send those changes in a single patch as
maintainers are different
 for different modules.

>
> Thanks,
> Nilesh
>

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

* Re: [PATCH] scsi: qla4xxx: Use dma_pool_zalloc
  2016-12-13 13:05     ` Souptick Joarder
@ 2016-12-21 11:43       ` Javali, Nilesh
  2016-12-21 13:24         ` Souptick Joarder
  0 siblings, 1 reply; 6+ messages in thread
From: Javali, Nilesh @ 2016-12-21 11:43 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: QLogic-Storage-Upstream@qlogic.com, linux-scsi@vger.kernel.org



On 13/12/16, 6:35 PM, "Souptick Joarder" <jrdr.linux@gmail.com> wrote:

>On Tue, Dec 13, 2016 at 4:11 PM, Javali, Nilesh
><Nilesh.Javali@cavium.com> wrote:
>>
>>
>> On 12/12/16, 10:16 AM, "linux-scsi-owner@vger.kernel.org on behalf of
>> Souptick Joarder" <linux-scsi-owner@vger.kernel.org on behalf of
>> jrdr.linux@gmail.com> wrote:
>>
>>>On Wed, Dec 7, 2016 at 1:53 AM, Souptick Joarder <jrdr.linux@gmail.com>
>>>wrote:
>>>> We should use dma_pool_zalloc instead of dma_pool_alloc/memset
>>>>
>>>> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
>>>> ---
>>>>  drivers/scsi/qla4xxx/ql4_mbx.c | 3 +--
>>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c
>>>>b/drivers/scsi/qla4xxx/ql4_mbx.c
>>>> index c291fdf..f2edfd7 100644
>>>> --- a/drivers/scsi/qla4xxx/ql4_mbx.c
>>>> +++ b/drivers/scsi/qla4xxx/ql4_mbx.c
>>>> @@ -1587,12 +1587,11 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha,
>>>>char *username, char *password,
>>>>         struct ql4_chap_table *chap_table;
>>>>         dma_addr_t chap_dma;
>>>>
>>>> -       chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL,
>>>>&chap_dma);
>>>> +       chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL,
>>>>&chap_dma);
>>>>         if (chap_table == NULL)
>>>>                 return -ENOMEM;
>>>>
>>>>         chap_size = sizeof(struct ql4_chap_table);
>>>> -       memset(chap_table, 0, chap_size);
>>>>
>>>>         if (is_qla40XX(ha))
>>>>                 offset = FLASH_CHAP_OFFSET | (idx * chap_size);
>>>> --
>>>> 1.9.1
>>>>
>>>
>>>Any comment on this patch?
>>
>> There are multiple other places where dma_pool_alloc needs to be
>>replaced
>> by dma_pool_zalloc.
>
>
> are you asking to do this for SCSI subsystem?
> If yes, I can do that.
>
>>
>> Can you please take care within a single patch.
>
> But the same changes are applicable in other subsystems as well.
> I think I shouldn't send those changes in a single patch as
>maintainers are different
> for different modules.

I'm referring to multiple other files within qla4xxx source which uses
dma_pool_alloc.
The current patch takes care only of ql4_mbx.c and qla4xxx_get_chap
function.
There is qla4xxx_set_chap function as well. Also ql4_init.c and ql4_os.c
files also use dma_pool_alloc.
I was requesting to make all these changes related to qla4xxx module
within a single patch.

Thanks,
Nilesh


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

* Re: [PATCH] scsi: qla4xxx: Use dma_pool_zalloc
  2016-12-21 11:43       ` Javali, Nilesh
@ 2016-12-21 13:24         ` Souptick Joarder
  0 siblings, 0 replies; 6+ messages in thread
From: Souptick Joarder @ 2016-12-21 13:24 UTC (permalink / raw)
  To: Javali, Nilesh
  Cc: QLogic-Storage-Upstream@qlogic.com, linux-scsi@vger.kernel.org

On Wed, Dec 21, 2016 at 5:13 PM, Javali, Nilesh
<Nilesh.Javali@cavium.com> wrote:
>
>
> On 13/12/16, 6:35 PM, "Souptick Joarder" <jrdr.linux@gmail.com> wrote:
>
>>On Tue, Dec 13, 2016 at 4:11 PM, Javali, Nilesh
>><Nilesh.Javali@cavium.com> wrote:
>>>
>>>
>>> On 12/12/16, 10:16 AM, "linux-scsi-owner@vger.kernel.org on behalf of
>>> Souptick Joarder" <linux-scsi-owner@vger.kernel.org on behalf of
>>> jrdr.linux@gmail.com> wrote:
>>>
>>>>On Wed, Dec 7, 2016 at 1:53 AM, Souptick Joarder <jrdr.linux@gmail.com>
>>>>wrote:
>>>>> We should use dma_pool_zalloc instead of dma_pool_alloc/memset
>>>>>
>>>>> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
>>>>> ---
>>>>>  drivers/scsi/qla4xxx/ql4_mbx.c | 3 +--
>>>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c
>>>>>b/drivers/scsi/qla4xxx/ql4_mbx.c
>>>>> index c291fdf..f2edfd7 100644
>>>>> --- a/drivers/scsi/qla4xxx/ql4_mbx.c
>>>>> +++ b/drivers/scsi/qla4xxx/ql4_mbx.c
>>>>> @@ -1587,12 +1587,11 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha,
>>>>>char *username, char *password,
>>>>>         struct ql4_chap_table *chap_table;
>>>>>         dma_addr_t chap_dma;
>>>>>
>>>>> -       chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL,
>>>>>&chap_dma);
>>>>> +       chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL,
>>>>>&chap_dma);
>>>>>         if (chap_table == NULL)
>>>>>                 return -ENOMEM;
>>>>>
>>>>>         chap_size = sizeof(struct ql4_chap_table);
>>>>> -       memset(chap_table, 0, chap_size);
>>>>>
>>>>>         if (is_qla40XX(ha))
>>>>>                 offset = FLASH_CHAP_OFFSET | (idx * chap_size);
>>>>> --
>>>>> 1.9.1
>>>>>
>>>>
>>>>Any comment on this patch?
>>>
>>> There are multiple other places where dma_pool_alloc needs to be
>>>replaced
>>> by dma_pool_zalloc.
>>
>>
>> are you asking to do this for SCSI subsystem?
>> If yes, I can do that.
>>
>>>
>>> Can you please take care within a single patch.
>>
>> But the same changes are applicable in other subsystems as well.
>> I think I shouldn't send those changes in a single patch as
>>maintainers are different
>> for different modules.
>
> I'm referring to multiple other files within qla4xxx source which uses
> dma_pool_alloc.
> The current patch takes care only of ql4_mbx.c and qla4xxx_get_chap
> function.
> There is qla4xxx_set_chap function as well. Also ql4_init.c and ql4_os.c
> files also use dma_pool_alloc.
> I was requesting to make all these changes related to qla4xxx module
> within a single patch.

Well I will do that.
>
> Thanks,
> Nilesh
>

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

end of thread, other threads:[~2016-12-21 13:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 20:23 [PATCH] scsi: qla4xxx: Use dma_pool_zalloc Souptick Joarder
2016-12-12  4:46 ` Souptick Joarder
2016-12-13 10:41   ` Javali, Nilesh
2016-12-13 13:05     ` Souptick Joarder
2016-12-21 11:43       ` Javali, Nilesh
2016-12-21 13:24         ` Souptick Joarder

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