From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Rothwell Subject: Re: linux-next: build warnings after merge of the akpm tree Date: Fri, 26 Oct 2012 01:16:45 +1100 Message-ID: <20121026011645.5a4e6adac51cf0bdc44e48bc@canb.auug.org.au> References: <20121025142854.1924363d6a607004f918ac63@canb.auug.org.au> <20121025143044.d21e2c29b16ee2005f93a371@canb.auug.org.au> <20121025141232.GB4730@richard.(null)> Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA256"; boundary="Signature=_Fri__26_Oct_2012_01_16_45_+1100_G6oLNqw28EGPa3C8" Return-path: In-Reply-To: <20121025141232.GB4730@richard.(null)> Sender: linux-kernel-owner@vger.kernel.org To: Richard Yang Cc: Andrew Morton , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-next.vger.kernel.org --Signature=_Fri__26_Oct_2012_01_16_45_+1100_G6oLNqw28EGPa3C8 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Richard, On Thu, 25 Oct 2012 22:12:32 +0800 Richard Yang wrote: > > I did a quick check.=20 >=20 > The root reason is,=20 > 1. kfifo_in() second parameter should be type "const void *" > 2. kfifo_out_locked() second parameter should be type "void *" > 3. kfifo_in_locked() second parameter should be type "const void *" >=20 > And I am curious about why the original code couldn't detect this type > mismatch. =20 >=20 > The reason is: the original code use =3D not =3D=3D.=20 > so when a const void * is assigned another pointer type, there is no warn= ing. >=20 > While I write this test code, there is still no warning.=20 > int main() > { > int *a;=20 > void* b; > b =3D a; // this should be ok. > a =3D b; // this should need the type transfer, but still no warning. > return 0; > }=20 >=20 > Hmm... not understand. Any error in my test code? Yes, any pointer can be assigned to a void pointer and a void pointer can be assigned to any pointer, so neither of the above should complain. --=20 Cheers, Stephen Rothwell sfr@canb.auug.org.au --Signature=_Fri__26_Oct_2012_01_16_45_+1100_G6oLNqw28EGPa3C8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCAAGBQJQiUnNAAoJEECxmPOUX5FEVsAQAJnO4pBL40JIw00691UOPg93 MJcWhNjtclBo92HfR4bafrkMuHby7YVzShkWZ5G0mJ3GRYDthFnf26uSWaTZ0DuE UuSTWfhWoIvJyzL9aAPLZYiOKgVi95b/dnhfFlrg8lRKHysMLarZErVlrMV7VXeq dWFow0ieIC5+tduUvaWUVDOvmsMiAfEMV8RK4Dyrn0yHuxhTZ/EvZa65iOrNL+g2 9zlLcsvCDey0cYT52CxzxRGwc8kXc5ra2Ee1JxqMP4mfNwxkiXaomiXIsv8qN8HE Ecnba17OxWpvpty/ytKx/3lKppmDQnzSWObx2lOke10rzetosS9ocvRF6SVAzIit Oy3YfGZVZNbVKIiV9K4LL+UpvvwWEcr7hjlXrNCqYxGbbN/D1dYgvYsGCoMiWQK7 BWVE43V/jU/kMMI55NJJIGtJ0ILZJnIsuZveh5olqn6XibaLSFGAUaj1s7zc0d9A KwqFiOkWFbh8KfDpeL6XGIg1xwY/DdmCCIUd5aAHxAYyhTELhlx+3XvW4/CvMeqH Y7JRu5/2EUDrGW8GSFBP+Vw3HDCCR2fSePWEUsKThRYhIy7LmNzMsE6qCIUO3OS4 JTNWZVkjyr6TPwY4YY5jUaplP959Gwxl4E/goEft9/sGneoNJIMj5xilBQ6HKHtL oPRTKwERticdK7Lws9qR =wEuT -----END PGP SIGNATURE----- --Signature=_Fri__26_Oct_2012_01_16_45_+1100_G6oLNqw28EGPa3C8--