Date: Thu, 14 Apr 2016 23:12:11 -0700 From: Peter Wemm <peter@wemm.org> To: svn-src-head@freebsd.org Cc: Pedro Giffuni <pfg@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r297974 - in head/sys: i386/i386 i386/ibcs2 x86/x86 Message-ID: <208673032.ZrzIEQ39cc@overcee.wemm.org> In-Reply-To: <570FCFE5.3010304@FreeBSD.org> References: <201604141704.u3EH47Vv063976@repo.freebsd.org> <570FCFE5.3010304@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Thursday, April 14, 2016 12:14:13 PM Pedro Giffuni wrote: > On 04/14/16 12:04, Pedro F. Giffuni wrote: > > Author: pfg > > Date: Thu Apr 14 17:04:06 2016 > > New Revision: 297974 > > URL: https://svnweb.freebsd.org/changeset/base/297974 > > > > Log: > > x86: for pointers replace 0 with NULL. > > > > These are mostly cosmetical, no functional change. > > > > Found with devel/coccinelle. > > > > Modified: > > head/sys/i386/i386/db_disasm.c > > head/sys/i386/i386/pmap.c > > head/sys/i386/ibcs2/imgact_coff.c > > head/sys/x86/x86/nexus.c > > ... > > > Modified: head/sys/i386/i386/pmap.c > > ========================================================================== > > ==== --- head/sys/i386/i386/pmap.c Thu Apr 14 16:32:27 2016 (r297973) > > +++ head/sys/i386/i386/pmap.c Thu Apr 14 17:04:06 2016 (r297974) > > @@ -269,15 +269,15 @@ pt_entry_t *CMAP3; > > > > static pd_entry_t *KPTD; > > caddr_t ptvmmap = 0; > > caddr_t CADDR3; > > > > -struct msgbuf *msgbufp = 0; > > +struct msgbuf *msgbufp = NULL; > > > > /* > > > > * Crashdump maps. > > */ > > > > static caddr_t crashdumpmap; > > > > -static pt_entry_t *PMAP1 = 0, *PMAP2; > > -static pt_entry_t *PADDR1 = 0, *PADDR2; > > +static pt_entry_t *PMAP1 = NULL, *PMAP2; > > +static pt_entry_t *PADDR1 = NULL, *PADDR2; > > > > #ifdef SMP > > static int PMAP1cpu; > > static int PMAP1changedcpu; > > Hmm .. being static, there is no need to initialize these. Several eons ago, at least some of these were initialized to force them into the data section so that they had known or safe values before the bss zero pass. I don't know if that was ever an issue on freebsd, or just the upstream code. You'd have to look well back into ancient 2.0 or earlier vintage code. I have a vague memory that our early a.out kernel had to zero its own bss because the early a.out boot blocks didn't, and these variables would have been caught in the crossfire. Or something.. In any case, I'd be surprised if the compiler didn't put them in the bss section these days anyway. At least without cc -ffreestanding, anyway. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJXEIY8AAoJEDXWlwnsgJ4EZf4H/0tsmQljb6s5XIxcOAHzAej8 rQU4i5Ka5jjzXVf044fjjKbQptAtJPr3C331VT+58iwxcDZECoy0V/v/UWKMaLW7 yB/216cLvMsPv5611tfDndLJ3peDVv9sixEgvVk9s3DYFCerbLg8N0PbmfeJxFSg 7YWPCdeVn++c8RRumB4Tc0DffE1QcU9KMoHih1My3Mkdv1kygdVO3SRi8yPLI66T 70rD/RHlGBM+76CMzFNfE4nZp8HmBmzmxSmFy/9kPhdxoa3wpNHcS2Mgg/d7WcLz z8g4dYgJxKAPiQA8ULHtD0Lrs87d/T5WOfHioq/S+9U/CRibk7YvHyK35FKEVNo= =BF9J -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?208673032.ZrzIEQ39cc>
