From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbcFFRPM (ORCPT ); Mon, 6 Jun 2016 13:15:12 -0400 Received: from anholt.net ([50.246.234.109]:47499 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbcFFRPK (ORCPT ); Mon, 6 Jun 2016 13:15:10 -0400 From: Eric Anholt To: Vinod Koul Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stephen Warren , Lee Jones , dmaengine@vger.kernel.org Subject: Re: [PATCH] dma: bcm2835: Fix compiler warning on arm64. In-Reply-To: <20160606042337.GT16910@localhost> References: <1465007013-5300-1-git-send-email-eric@anholt.net> <20160606042337.GT16910@localhost> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Mon, 06 Jun 2016 10:15:05 -0700 Message-ID: <87eg8a6xye.fsf@eliezer.anholt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Vinod Koul writes: > 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. >>=20 >> Signed-off-by: Eric Anholt >> --- >>=20 >> 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. >>=20 >> drivers/dma/bcm2835-dma.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> 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 =3D to_bcm2835_dma_chan(chan); >> - size_t max_len =3D bcm2835_dma_max_frame_length(c); >> + unsigned int max_len =3D 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? Assignments from different sizes don't produce warnings. The other arg of the min() is a u32, and this value is known to be < u32, so I don't see the problem. I could start promoting u32s to size_ts instead, but I don't know where that would end. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJXVa+ZAAoJELXWKTbR/J7o3jQP/0VQ2xqdwZQI66Ut8ehIc0l3 dbE2h404FBqRLBZ7nFLfzHHqmra4YN9mrHa6TEtHi/x/RlcdQkgBKw90NqkIUDj2 LZ5/aOcVZpu7njfJrnd86NdAOSPyXE3Sg+9k0vRxI6QDEilIetr4Y2LL64UuLx9D IPLfEOQyssfVo+A3AposHp2Vc/7FYHLX9xVdUOgAwPr3vj1gZWEzUnSiu7Qbp9VN a5TVQW+8Q6wku5wbTfwck3JfnA1RxuY6mEO5VGER1n1FQ7HIMBibOZZw2SHeNyf5 azhHaol94a9N1DgtzwB8Dmz782YmYwkZQXIrsfO6R7Mq4i8j+yIeVx0401svuh/g +daYNAeG3V0QxxG+tEGafffSjWvXv9Nl/QKGnD8MShNNSmLxX3RRHYDDHVrf8ltD VzaDyrD6U5v34dvEMaQEv5XqcEt0rktwmqAcDXEpUW4oKtoG8RnraxusA1zmv3vs PuiouwgdIhi7KBW2lN9Qsgx6VV4ZFCwVUqtZk0cE3uDzKGYpUZtaFAYzOrspH3K/ L3+xWfD1e5ETXQ4LD1pBwIL2SGRgwtSYumLVOQ8c5KA8RhiUqgi9unNA282/9kp8 OPRQtcOByCqfXbyakSjpE2bkKiog+moY4f6++vpVLhsd5hKbpujRVp1EusNd3Wrm L0sTktLNF5CiagIyyqdN =Erpv -----END PGP SIGNATURE----- --=-=-=--