All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: sean.wang@mediatek.com
Cc: dan.j.williams@intel.com, robh+dt@kernel.org,
	mark.rutland@arm.com, dmaengine@vger.kernel.org,
	devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Fengguang Wu <fengguang.wu@intel.com>,
	Julia Lawall <julia.lawall@lip6.fr>
Subject: [v4,5/5] dmaengine: mediatek: fix zalloc-simple.cocci warnings
Date: Fri, 9 Feb 2018 18:28:18 +0530	[thread overview]
Message-ID: <20180209125817.GB3666@localhost> (raw)

On Fri, Feb 09, 2018 at 01:58:51AM +0800, sean.wang@mediatek.com wrote:
> From: Fengguang Wu <fengguang.wu@intel.com>
> 
>  Use zeroing allocator rather than allocator followed by memset with 0
> 
> Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci
> 
> Fixes: c8e4b2e4ca21 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")
> Cc: Sean Wang <sean.wang@mediatek.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  drivers/dma/mediatek/mtk-hsdma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
> index 42b5b23..d3b90fe 100644
> --- a/drivers/dma/mediatek/mtk-hsdma.c
> +++ b/drivers/dma/mediatek/mtk-hsdma.c
> @@ -325,13 +325,11 @@ static int mtk_hsdma_alloc_pchan(struct mtk_hsdma_device *hsdma,
>  	 * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring.
>  	 */
>  	pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd);
> -	ring->txd = dma_alloc_coherent(hsdma2dev(hsdma),
> -				       pc->sz_ring, &ring->tphys,
> -				       GFP_ATOMIC | __GFP_ZERO);
> +	ring->txd = dma_zalloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
> +					&ring->tphys, GFP_ATOMIC);
>  	if (!ring->txd)
>  		return -ENOMEM;
>  
> -	memset(ring->txd, 0, pc->sz_ring);

This should be folded back..

>  	ring->rxd = &ring->txd[MTK_DMA_SIZE];
>  	ring->rphys = ring->tphys + MTK_DMA_SIZE * sizeof(*ring->txd);
>  	ring->cur_tptr = 0;
> -- 
> 2.7.4
>

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org
Cc: dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Fengguang Wu
	<fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
Subject: Re: [PATCH v4 5/5] dmaengine: mediatek: fix zalloc-simple.cocci warnings
Date: Fri, 9 Feb 2018 18:28:18 +0530	[thread overview]
Message-ID: <20180209125817.GB3666@localhost> (raw)
In-Reply-To: <ede5702c460a5b4b41186a8cff1e3c29b2380c08.1518110810.git.sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

On Fri, Feb 09, 2018 at 01:58:51AM +0800, sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org wrote:
> From: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
>  Use zeroing allocator rather than allocator followed by memset with 0
> 
> Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci
> 
> Fixes: c8e4b2e4ca21 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")
> Cc: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
> Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/dma/mediatek/mtk-hsdma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
> index 42b5b23..d3b90fe 100644
> --- a/drivers/dma/mediatek/mtk-hsdma.c
> +++ b/drivers/dma/mediatek/mtk-hsdma.c
> @@ -325,13 +325,11 @@ static int mtk_hsdma_alloc_pchan(struct mtk_hsdma_device *hsdma,
>  	 * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring.
>  	 */
>  	pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd);
> -	ring->txd = dma_alloc_coherent(hsdma2dev(hsdma),
> -				       pc->sz_ring, &ring->tphys,
> -				       GFP_ATOMIC | __GFP_ZERO);
> +	ring->txd = dma_zalloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
> +					&ring->tphys, GFP_ATOMIC);
>  	if (!ring->txd)
>  		return -ENOMEM;
>  
> -	memset(ring->txd, 0, pc->sz_ring);

This should be folded back..

>  	ring->rxd = &ring->txd[MTK_DMA_SIZE];
>  	ring->rphys = ring->tphys + MTK_DMA_SIZE * sizeof(*ring->txd);
>  	ring->cur_tptr = 0;
> -- 
> 2.7.4
> 

-- 
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 5/5] dmaengine: mediatek: fix zalloc-simple.cocci warnings
Date: Fri, 9 Feb 2018 18:28:18 +0530	[thread overview]
Message-ID: <20180209125817.GB3666@localhost> (raw)
In-Reply-To: <ede5702c460a5b4b41186a8cff1e3c29b2380c08.1518110810.git.sean.wang@mediatek.com>

On Fri, Feb 09, 2018 at 01:58:51AM +0800, sean.wang at mediatek.com wrote:
> From: Fengguang Wu <fengguang.wu@intel.com>
> 
>  Use zeroing allocator rather than allocator followed by memset with 0
> 
> Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci
> 
> Fixes: c8e4b2e4ca21 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")
> Cc: Sean Wang <sean.wang@mediatek.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  drivers/dma/mediatek/mtk-hsdma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
> index 42b5b23..d3b90fe 100644
> --- a/drivers/dma/mediatek/mtk-hsdma.c
> +++ b/drivers/dma/mediatek/mtk-hsdma.c
> @@ -325,13 +325,11 @@ static int mtk_hsdma_alloc_pchan(struct mtk_hsdma_device *hsdma,
>  	 * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring.
>  	 */
>  	pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd);
> -	ring->txd = dma_alloc_coherent(hsdma2dev(hsdma),
> -				       pc->sz_ring, &ring->tphys,
> -				       GFP_ATOMIC | __GFP_ZERO);
> +	ring->txd = dma_zalloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
> +					&ring->tphys, GFP_ATOMIC);
>  	if (!ring->txd)
>  		return -ENOMEM;
>  
> -	memset(ring->txd, 0, pc->sz_ring);

This should be folded back..

>  	ring->rxd = &ring->txd[MTK_DMA_SIZE];
>  	ring->rphys = ring->tphys + MTK_DMA_SIZE * sizeof(*ring->txd);
>  	ring->cur_tptr = 0;
> -- 
> 2.7.4
> 

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: sean.wang@mediatek.com
Cc: dan.j.williams@intel.com, robh+dt@kernel.org,
	mark.rutland@arm.com, dmaengine@vger.kernel.org,
	devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Fengguang Wu <fengguang.wu@intel.com>,
	Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH v4 5/5] dmaengine: mediatek: fix zalloc-simple.cocci warnings
Date: Fri, 9 Feb 2018 18:28:18 +0530	[thread overview]
Message-ID: <20180209125817.GB3666@localhost> (raw)
In-Reply-To: <ede5702c460a5b4b41186a8cff1e3c29b2380c08.1518110810.git.sean.wang@mediatek.com>

On Fri, Feb 09, 2018 at 01:58:51AM +0800, sean.wang@mediatek.com wrote:
> From: Fengguang Wu <fengguang.wu@intel.com>
> 
>  Use zeroing allocator rather than allocator followed by memset with 0
> 
> Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci
> 
> Fixes: c8e4b2e4ca21 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")
> Cc: Sean Wang <sean.wang@mediatek.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  drivers/dma/mediatek/mtk-hsdma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
> index 42b5b23..d3b90fe 100644
> --- a/drivers/dma/mediatek/mtk-hsdma.c
> +++ b/drivers/dma/mediatek/mtk-hsdma.c
> @@ -325,13 +325,11 @@ static int mtk_hsdma_alloc_pchan(struct mtk_hsdma_device *hsdma,
>  	 * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring.
>  	 */
>  	pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd);
> -	ring->txd = dma_alloc_coherent(hsdma2dev(hsdma),
> -				       pc->sz_ring, &ring->tphys,
> -				       GFP_ATOMIC | __GFP_ZERO);
> +	ring->txd = dma_zalloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
> +					&ring->tphys, GFP_ATOMIC);
>  	if (!ring->txd)
>  		return -ENOMEM;
>  
> -	memset(ring->txd, 0, pc->sz_ring);

This should be folded back..

>  	ring->rxd = &ring->txd[MTK_DMA_SIZE];
>  	ring->rphys = ring->tphys + MTK_DMA_SIZE * sizeof(*ring->txd);
>  	ring->cur_tptr = 0;
> -- 
> 2.7.4
> 

-- 
~Vinod

             reply	other threads:[~2018-02-09 12:58 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 12:58 Vinod Koul [this message]
2018-02-09 12:58 ` [PATCH v4 5/5] dmaengine: mediatek: fix zalloc-simple.cocci warnings Vinod Koul
2018-02-09 12:58 ` Vinod Koul
2018-02-09 12:58 ` Vinod Koul
  -- strict thread matches above, loose matches on Subject: below --
2018-02-13  7:07 [v4,5/5] " Julia Lawall
2018-02-13  7:07 ` [PATCH v4 5/5] " Julia Lawall
2018-02-13  7:07 ` Julia Lawall
2018-02-13  7:07 ` Julia Lawall
2018-02-13  6:46 [v4,5/5] " Vinod Koul
2018-02-13  6:46 ` [PATCH v4 5/5] " Vinod Koul
2018-02-13  6:46 ` Vinod Koul
2018-02-13  6:46 ` Vinod Koul
2018-02-09 14:55 [v4,5/5] " Julia Lawall
2018-02-09 14:55 ` [PATCH v4 5/5] " Julia Lawall
2018-02-09 14:55 ` Julia Lawall
2018-02-08 19:14 [v4,2/5] dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC Randy Dunlap
2018-02-08 19:14 ` [PATCH v4 2/5] " Randy Dunlap
2018-02-08 19:14 ` Randy Dunlap
2018-02-08 17:58 [v4,5/5] dmaengine: mediatek: fix zalloc-simple.cocci warnings sean.wang
2018-02-08 17:58 ` [PATCH v4 5/5] " sean.wang
2018-02-08 17:58 ` sean.wang at mediatek.com
2018-02-08 17:58 ` sean.wang
2018-02-08 17:58 [v4,4/5] dmaengine: mediatek: mtk_hsdma_find_active_desc() can be static sean.wang
2018-02-08 17:58 ` [PATCH v4 4/5] " sean.wang
2018-02-08 17:58 ` sean.wang at mediatek.com
2018-02-08 17:58 ` sean.wang
2018-02-08 17:58 [v4,3/5] dmaengine: mediatek: update MAINTAINERS entry with MediaTek DMA driver sean.wang
2018-02-08 17:58 ` [PATCH v4 3/5] " sean.wang
2018-02-08 17:58 ` sean.wang at mediatek.com
2018-02-08 17:58 ` sean.wang
2018-02-08 17:58 [v4,2/5] dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC sean.wang
2018-02-08 17:58 ` [PATCH v4 2/5] " sean.wang
2018-02-08 17:58 ` sean.wang at mediatek.com
2018-02-08 17:58 ` sean.wang
2018-02-08 17:58 [v4,1/5] dt-bindings: dmaengine: Add MediaTek High-Speed DMA controller bindings sean.wang
2018-02-08 17:58 ` [PATCH v4 1/5] " sean.wang
2018-02-08 17:58 ` sean.wang at mediatek.com
2018-02-08 17:58 ` sean.wang
2018-02-08 17:58 [PATCH v4 0/5] add support for Mediatek High-Speed DMA controller on MT7622 and MT7623 SoC sean.wang-NuS5LvNUpcJWk0Htik3J/w
2018-02-08 17:58 ` sean.wang
2018-02-08 17:58 ` sean.wang at mediatek.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180209125817.GB3666@localhost \
    --to=vinod.koul@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=fengguang.wu@intel.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sean.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.