Date: Thu, 26 Dec 2013 00:26:25 +0100 From: Dimitry Andric <dim@FreeBSD.org> To: Ian Lepore <ian@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r259893 - head/sys/vm Message-ID: <CE522744-21A4-42CD-B621-86C517A94480@FreeBSD.org> In-Reply-To: <1388012382.1158.128.camel@revolution.hippie.lan> References: <201312252232.rBPMWZ6a042376@svn.freebsd.org> <1388012382.1158.128.camel@revolution.hippie.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 25 Dec 2013, at 23:59, Ian Lepore <ian@FreeBSD.org> 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 >> >> 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]"). >> >> MFC after: 3 days >> >> Modified: >> head/sys/vm/vm_pageout.c >> >> Modified: head/sys/vm/vm_pageout.c >> ============================================================================== >> --- 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); >> } >> >> /* > > 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 = 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 = (uintptr_t)arg; [...] -Dimitry [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlK7aagACgkQsF6jCi4glqPcfwCg03UHkMblSxl2AgiU6fuexbH6 EIMAoPc8QIAn0Jne12KKWo35W2FiSUSd =dOz+ -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CE522744-21A4-42CD-B621-86C517A94480>
