From owner-svn-src-head@FreeBSD.ORG Wed Dec 25 23:26:45 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 317829C2; Wed, 25 Dec 2013 23:26:45 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF6631CC9; Wed, 25 Dec 2013 23:26:44 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::559:dc8f:9307:627e] (unknown [IPv6:2001:7b8:3a7:0:559:dc8f:9307:627e]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A141D5C43; Thu, 26 Dec 2013 00:26:41 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_9C59DB62-B4DA-4A82-A008-1F846AC7BE49"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r259893 - head/sys/vm From: Dimitry Andric In-Reply-To: <1388012382.1158.128.camel@revolution.hippie.lan> Date: Thu, 26 Dec 2013 00:26:25 +0100 Message-Id: References: <201312252232.rBPMWZ6a042376@svn.freebsd.org> <1388012382.1158.128.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Dec 2013 23:26:45 -0000 --Apple-Mail=_9C59DB62-B4DA-4A82-A008-1F846AC7BE49 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 25 Dec 2013, at 23:59, Ian Lepore wrote: > On Wed, 2013-12-25 at 22:32 +0000, Dimitry Andric wrote: >> Author: dim >> Date: Wed Dec 25 22:32:34 2013 >> New Revision: 259893 >> URL: http://svnweb.freebsd.org/changeset/base/259893 >>=20 >> Log: >> In sys/vm/vm_pageout.c, since vm_pageout_worker() takes a void * as >> argument, cast the incoming 0 argument to void *, to silence a = warning >> from clang 3.4 ("expression which evaluates to zero treated as a = null >> pointer constant of type 'void *' [-Wnon-literal-null-conversion]"). >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/sys/vm/vm_pageout.c >>=20 >> Modified: head/sys/vm/vm_pageout.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/vm/vm_pageout.c Wed Dec 25 22:14:42 2013 = (r259892) >> +++ head/sys/vm/vm_pageout.c Wed Dec 25 22:32:34 2013 = (r259893) >> @@ -1699,7 +1699,7 @@ vm_pageout(void) >> } >> } >> #endif >> - vm_pageout_worker((uintptr_t)0); >> + vm_pageout_worker((void *)(uintptr_t)0); >> } >>=20 >> /* >=20 > Why isn't the fix for this just vm_pageout_worker(NULL); ? Because the argument is meant as a literal zero, in this case. The vm_pageout_worker() function only has a void * argument, because it is used as a thread function for kthread_add(9); see just a few lines above: error =3D kthread_add(vm_pageout_worker, (void = *)(uintptr_t)i, [...] Upon entry to vm_pageout_worker(), the incoming 'pointer' is immediately converted back into an intptr_t: static void vm_pageout_worker(void *arg) { struct vm_domain *domain; int domidx; domidx =3D (uintptr_t)arg; [...] -Dimitry --Apple-Mail=_9C59DB62-B4DA-4A82-A008-1F846AC7BE49 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlK7aagACgkQsF6jCi4glqPcfwCg03UHkMblSxl2AgiU6fuexbH6 EIMAoPc8QIAn0Jne12KKWo35W2FiSUSd =dOz+ -----END PGP SIGNATURE----- --Apple-Mail=_9C59DB62-B4DA-4A82-A008-1F846AC7BE49--