Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1414616

Re: [PATCH] dma: bcm2835: Fix compiler warning on arm64.

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Vinod Koul <vinod.koul@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] dma: bcm2835: Fix compiler warning on arm64.
Date Mon, 06 Jun 2016 06:20:01 +0200
Message-ID <rGUb7-8fk-9@gated-at.bofh.it> (permalink)
References <rG9vz-2XA-5@gated-at.bofh.it>
X-Original-To Eric Anholt <eric@anholt.net>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.26,425,1459839600"; d="scan'208";a="714472356"
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stephen Warren <swarren@wwwdotorg.org>, Lee Jones <lee@kernel.org>, dmaengine@vger.kernel.org
X-Original-Date Mon, 6 Jun 2016 09:53:38 +0530
X-Original-Message-ID <20160606042337.GT16910@localhost>
X-Original-References <1465007013-5300-1-git-send-email-eric@anholt.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1414616

Show key headers only | View raw


On Fri, Jun 03, 2016 at 07:23:33PM -0700, Eric Anholt wrote:
> The min() macro was complaining about mismatched types.  The max len
> is at most SZ_1G, so we can just put it in an unsigned int.
> 
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---
> 
> Vinod, if you ack it, this one would be nice to be able to merge
> through the -soc tree, so that when we enable of arm64 builds of this
> driver we don't introduce a new compiler warning.
> 
>  drivers/dma/bcm2835-dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
> index 6149b27c33ad..1fa11fc067c6 100644
> --- a/drivers/dma/bcm2835-dma.c
> +++ b/drivers/dma/bcm2835-dma.c
> @@ -393,7 +393,7 @@ static void bcm2835_dma_fill_cb_chain_with_sg(
>  	unsigned int sg_len)
>  {
>  	struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
> -	size_t max_len = bcm2835_dma_max_frame_length(c);
> +	unsigned int max_len = bcm2835_dma_max_frame_length(c);

bcm2835_dma_max_frame_length() returns size_t. so this should also add a
complain about type mismatch as well!

Also, wouldn't it be better to make both args of min()  as size_t then?

>  	unsigned int i, len;
>  	dma_addr_t addr;
>  	struct scatterlist *sgent;
> -- 
> 2.8.0.rc3
> 

Thanks
-- 
~Vinod

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] dma: bcm2835: Fix compiler warning on arm64. Eric Anholt <eric@anholt.net> - 2016-06-04 04:30 +0200
  Re: [PATCH] dma: bcm2835: Fix compiler warning on arm64. Vinod Koul <vinod.koul@intel.com> - 2016-06-06 06:20 +0200
    Re: [PATCH] dma: bcm2835: Fix compiler warning on arm64. Eric Anholt <eric@anholt.net> - 2016-06-06 19:20 +0200

csiph-web