* Re: [PATCH] net: wan: Use dma_pool_zalloc
[not found] ` <m3wpf9l0fc.fsf@t19.piap.pl>
@ 2016-12-12 4:42 ` Souptick Joarder
2016-12-15 5:11 ` Souptick Joarder
0 siblings, 1 reply; 7+ messages in thread
From: Souptick Joarder @ 2016-12-12 4:42 UTC (permalink / raw)
To: Krzysztof Hałasa, netdev; +Cc: Rameshwar Sahu
On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof Hałasa <khalasa@piap.pl> wrote:
> Souptick Joarder <jrdr.linux@gmail.com> writes:
>
>> We should use dma_pool_zalloc instead of dma_pool_alloc/memset
>>
>> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
>> ---
>> drivers/net/wan/ixp4xx_hss.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
>> index e7bbdb7..aaabf31 100644
>> --- a/drivers/net/wan/ixp4xx_hss.c
>> +++ b/drivers/net/wan/ixp4xx_hss.c
>> @@ -976,10 +976,9 @@ static int init_hdlc_queues(struct port *port)
>> return -ENOMEM;
>> }
>>
>> - if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
>> - &port->desc_tab_phys)))
>> + if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
>> + &port->desc_tab_phys)))
>> return -ENOMEM;
>> - memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
>> memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
>> memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
>
> This look fine, feel free to send it to the netdev mailing list for
> inclusion.
Including netdev mailing list based as requested.
>
> Acked-by: Krzysztof Halasa <khalasa@piap.pl>
> --
> Krzysztof Halasa
>
> Industrial Research Institute for Automation and Measurements PIAP
> Al. Jerozolimskie 202, 02-486 Warsaw, Poland
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] net: wan: Use dma_pool_zalloc
2016-12-12 4:42 ` [PATCH] net: wan: Use dma_pool_zalloc Souptick Joarder
@ 2016-12-15 5:11 ` Souptick Joarder
2016-12-15 16:48 ` Joe Perches
0 siblings, 1 reply; 7+ messages in thread
From: Souptick Joarder @ 2016-12-15 5:11 UTC (permalink / raw)
To: Krzysztof Hałasa, netdev; +Cc: Rameshwar Sahu
On Mon, Dec 12, 2016 at 10:12 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof Hałasa <khalasa@piap.pl> wrote:
>> Souptick Joarder <jrdr.linux@gmail.com> writes:
>>
>>> We should use dma_pool_zalloc instead of dma_pool_alloc/memset
>>>
>>> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
>>> ---
>>> drivers/net/wan/ixp4xx_hss.c | 5 ++---
>>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
>>> index e7bbdb7..aaabf31 100644
>>> --- a/drivers/net/wan/ixp4xx_hss.c
>>> +++ b/drivers/net/wan/ixp4xx_hss.c
>>> @@ -976,10 +976,9 @@ static int init_hdlc_queues(struct port *port)
>>> return -ENOMEM;
>>> }
>>>
>>> - if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
>>> - &port->desc_tab_phys)))
>>> + if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
>>> + &port->desc_tab_phys)))
>>> return -ENOMEM;
>>> - memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
>>> memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
>>> memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
>>
>> This look fine, feel free to send it to the netdev mailing list for
>> inclusion.
>
> Including netdev mailing list based as requested.
>
>>
>> Acked-by: Krzysztof Halasa <khalasa@piap.pl>
>> --
>> Krzysztof Halasa
>>
>> Industrial Research Institute for Automation and Measurements PIAP
>> Al. Jerozolimskie 202, 02-486 Warsaw, Poland
Any comment on this patch ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] net: wan: Use dma_pool_zalloc
2016-12-15 5:11 ` Souptick Joarder
@ 2016-12-15 16:48 ` Joe Perches
2016-12-16 6:03 ` Souptick Joarder
0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2016-12-15 16:48 UTC (permalink / raw)
To: Souptick Joarder, Krzysztof Hałasa, netdev; +Cc: Rameshwar Sahu
On Thu, 2016-12-15 at 10:41 +0530, Souptick Joarder wrote:
> On Mon, Dec 12, 2016 at 10:12 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> > On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof Hałasa <khalasa@piap.pl> wrote:
> > > Souptick Joarder <jrdr.linux@gmail.com> writes:
> > >
> > > > We should use dma_pool_zalloc instead of dma_pool_alloc/memset
[]
> > > > diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
[]
> > > > @@ -976,10 +976,9 @@ static int init_hdlc_queues(struct port *port)
> > > > return -ENOMEM;
> > > > }
> > > >
> > > > - if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
> > > > - &port->desc_tab_phys)))
> > > > + if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
> > > > + &port->desc_tab_phys)))
> > > > return -ENOMEM;
> > > > - memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
> > > > memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
> > > > memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
> > >
> > > This look fine, feel free to send it to the netdev mailing list for
> > > inclusion.
> >
> > Including netdev mailing list based as requested.
> > > Acked-by: Krzysztof Halasa <khalasa@piap.pl>
[]
> Any comment on this patch ?
Shouldn't the one in drivers/net/ethernet/xscale/ixp4xx_eth.c
also be changed?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] net: wan: Use dma_pool_zalloc
2016-12-15 16:48 ` Joe Perches
@ 2016-12-16 6:03 ` Souptick Joarder
2016-12-16 6:10 ` Joe Perches
0 siblings, 1 reply; 7+ messages in thread
From: Souptick Joarder @ 2016-12-16 6:03 UTC (permalink / raw)
To: Joe Perches; +Cc: Krzysztof Hałasa, netdev, Rameshwar Sahu
On Thu, Dec 15, 2016 at 10:18 PM, Joe Perches <joe@perches.com> wrote:
> On Thu, 2016-12-15 at 10:41 +0530, Souptick Joarder wrote:
>> On Mon, Dec 12, 2016 at 10:12 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> > On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof Hałasa <khalasa@piap.pl> wrote:
>> > > Souptick Joarder <jrdr.linux@gmail.com> writes:
>> > >
>> > > > We should use dma_pool_zalloc instead of dma_pool_alloc/memset
> []
>> > > > diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
> []
>> > > > @@ -976,10 +976,9 @@ static int init_hdlc_queues(struct port *port)
>> > > > return -ENOMEM;
>> > > > }
>> > > >
>> > > > - if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
>> > > > - &port->desc_tab_phys)))
>> > > > + if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
>> > > > + &port->desc_tab_phys)))
>> > > > return -ENOMEM;
>> > > > - memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
>> > > > memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
>> > > > memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
>> > >
>> > > This look fine, feel free to send it to the netdev mailing list for
>> > > inclusion.
>> >
>> > Including netdev mailing list based as requested.
>> > > Acked-by: Krzysztof Halasa <khalasa@piap.pl>
> []
>> Any comment on this patch ?
>
> Shouldn't the one in drivers/net/ethernet/xscale/ixp4xx_eth.c
> also be changed?
Yes, you are right. Do you want me to include it in same patch?
Regards
Souptick
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] net: wan: Use dma_pool_zalloc
2016-12-16 6:03 ` Souptick Joarder
@ 2016-12-16 6:10 ` Joe Perches
2016-12-16 13:55 ` Souptick Joarder
0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2016-12-16 6:10 UTC (permalink / raw)
To: Souptick Joarder; +Cc: Krzysztof Hałasa, netdev, Rameshwar Sahu
On Fri, 2016-12-16 at 11:33 +0530, Souptick Joarder wrote:
> On Thu, Dec 15, 2016 at 10:18 PM, Joe Perches <joe@perches.com> wrote:
> > On Thu, 2016-12-15 at 10:41 +0530, Souptick Joarder wrote:
> > > On Mon, Dec 12, 2016 at 10:12 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> > > > On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof Hałasa <khalasa@piap.pl> wrote:
> > > > > Souptick Joarder <jrdr.linux@gmail.com> writes:
> > > > >
> > > > > > We should use dma_pool_zalloc instead of dma_pool_alloc/memset
> >
> > []
> > > > > > diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
> >
> > []
> > > > > > @@ -976,10 +976,9 @@ static int init_hdlc_queues(struct port *port)
> > > > > > return -ENOMEM;
> > > > > > }
> > > > > >
> > > > > > - if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
> > > > > > - &port->desc_tab_phys)))
> > > > > > + if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
> > > > > > + &port->desc_tab_phys)))
> > > > > > return -ENOMEM;
> > > > > > - memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
> > > > > > memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
> > > > > > memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
> > > > >
> > > > > This look fine, feel free to send it to the netdev mailing list for
> > > > > inclusion.
> > > >
> > > > Including netdev mailing list based as requested.
> > > > > Acked-by: Krzysztof Halasa <khalasa@piap.pl>
> >
> > []
> > > Any comment on this patch ?
> >
> > Shouldn't the one in drivers/net/ethernet/xscale/ixp4xx_eth.c
> > also be changed?
>
> Yes, you are right. Do you want me to include it in same patch?
Your choice. I would use a single patch.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] net: wan: Use dma_pool_zalloc
2016-12-16 6:10 ` Joe Perches
@ 2016-12-16 13:55 ` Souptick Joarder
2016-12-17 0:17 ` Joe Perches
0 siblings, 1 reply; 7+ messages in thread
From: Souptick Joarder @ 2016-12-16 13:55 UTC (permalink / raw)
To: Joe Perches; +Cc: Krzysztof Hałasa, netdev, Rameshwar Sahu
On Fri, Dec 16, 2016 at 11:40 AM, Joe Perches <joe@perches.com> wrote:
> On Fri, 2016-12-16 at 11:33 +0530, Souptick Joarder wrote:
>> On Thu, Dec 15, 2016 at 10:18 PM, Joe Perches <joe@perches.com> wrote:
>> > On Thu, 2016-12-15 at 10:41 +0530, Souptick Joarder wrote:
>> > > On Mon, Dec 12, 2016 at 10:12 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> > > > On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof Hałasa <khalasa@piap.pl> wrote:
>> > > > > Souptick Joarder <jrdr.linux@gmail.com> writes:
>> > > > >
>> > > > > > We should use dma_pool_zalloc instead of dma_pool_alloc/memset
>> >
>> > []
>> > > > > > diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
>> >
>> > []
>> > > > > > @@ -976,10 +976,9 @@ static int init_hdlc_queues(struct port *port)
>> > > > > > return -ENOMEM;
>> > > > > > }
>> > > > > >
>> > > > > > - if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
>> > > > > > - &port->desc_tab_phys)))
>> > > > > > + if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
>> > > > > > + &port->desc_tab_phys)))
>> > > > > > return -ENOMEM;
>> > > > > > - memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
>> > > > > > memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
>> > > > > > memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
>> > > > >
>> > > > > This look fine, feel free to send it to the netdev mailing list for
>> > > > > inclusion.
>> > > >
>> > > > Including netdev mailing list based as requested.
>> > > > > Acked-by: Krzysztof Halasa <khalasa@piap.pl>
>> >
>> > []
>> > > Any comment on this patch ?
>> >
>> > Shouldn't the one in drivers/net/ethernet/xscale/ixp4xx_eth.c
>> > also be changed?
>>
>> Yes, you are right. Do you want me to include it in same patch?
>
> Your choice. I would use a single patch.
There are few other places where the same change is applicable.
I am planning to put all those changes in a single patch. It includes
changes in drivers/net/ethernet/xscale/ixp4xx_eth.c
You can review this patch separately.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] net: wan: Use dma_pool_zalloc
2016-12-16 13:55 ` Souptick Joarder
@ 2016-12-17 0:17 ` Joe Perches
0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2016-12-17 0:17 UTC (permalink / raw)
To: Souptick Joarder; +Cc: Krzysztof Hałasa, netdev, Rameshwar Sahu
On Fri, 2016-12-16 at 19:25 +0530, Souptick Joarder wrote:
> On Fri, Dec 16, 2016 at 11:40 AM, Joe Perches <joe@perches.com> wrote:
> > On Fri, 2016-12-16 at 11:33 +0530, Souptick Joarder wrote:
> > > On Thu, Dec 15, 2016 at 10:18 PM, Joe Perches <joe@perches.com> wrote:
> > > > On Thu, 2016-12-15 at 10:41 +0530, Souptick Joarder wrote:
> > > > > On Mon, Dec 12, 2016 at 10:12 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> > > > > > On Fri, Dec 9, 2016 at 6:33 PM, Krzysztof Hałasa <khalasa@piap.pl> wrote:
> > > > > > > Souptick Joarder <jrdr.linux@gmail.com> writes:
> > > > > > >
> > > > > > > > We should use dma_pool_zalloc instead of dma_pool_alloc/memset
> > > >
> > > > []
> > > > > > > > diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
> > > >
> > > > []
> > > > > > > > @@ -976,10 +976,9 @@ static int init_hdlc_queues(struct port *port)
> > > > > > > > return -ENOMEM;
> > > > > > > > }
> > > > > > > >
> > > > > > > > - if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
> > > > > > > > - &port->desc_tab_phys)))
> > > > > > > > + if (!(port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
> > > > > > > > + &port->desc_tab_phys)))
> > > > > > > > return -ENOMEM;
> > > > > > > > - memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
> > > > > > > > memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
> > > > > > > > memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
> > > > > > >
> > > > > > > This look fine, feel free to send it to the netdev mailing list for
> > > > > > > inclusion.
> > > > > >
> > > > > > Including netdev mailing list based as requested.
> > > > > > > Acked-by: Krzysztof Halasa <khalasa@piap.pl>
> > > >
> > > > []
> > > > > Any comment on this patch ?
> > > >
> > > > Shouldn't the one in drivers/net/ethernet/xscale/ixp4xx_eth.c
> > > > also be changed?
> > >
> > > Yes, you are right. Do you want me to include it in same patch?
> >
> > Your choice. I would use a single patch.
>
> There are few other places where the same change is applicable.
> I am planning to put all those changes in a single patch. It includes
> changes in drivers/net/ethernet/xscale/ixp4xx_eth.c
>
> You can review this patch separately.
If you are spanning multiple drivers maintained by different
groups, it's probably better to create a patch series, one for
each driver, to allow the various maintainers to apply the
patches to their individually maintained drivers.
Joe
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-12-17 0:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20161203091447.GA5231@jordon-HP-15-Notebook-PC>
[not found] ` <m3wpf9l0fc.fsf@t19.piap.pl>
2016-12-12 4:42 ` [PATCH] net: wan: Use dma_pool_zalloc Souptick Joarder
2016-12-15 5:11 ` Souptick Joarder
2016-12-15 16:48 ` Joe Perches
2016-12-16 6:03 ` Souptick Joarder
2016-12-16 6:10 ` Joe Perches
2016-12-16 13:55 ` Souptick Joarder
2016-12-17 0:17 ` Joe Perches
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.