From owner-freebsd-current@FreeBSD.ORG Tue Mar 8 20:43:14 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 151B91065675; Tue, 8 Mar 2011 20:43:14 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.31.26]) by mx1.freebsd.org (Postfix) with ESMTP id 951678FC14; Tue, 8 Mar 2011 20:43:13 +0000 (UTC) Received: from [78.34.131.250] (helo=r500.local) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1Px3UU-0005VA-E3; Tue, 08 Mar 2011 21:26:46 +0100 Date: Tue, 8 Mar 2011 21:19:31 +0100 From: Fabian Keil To: Roman Divacky Message-ID: <20110308211931.1c5deb8b@r500.local> In-Reply-To: <20110308173909.GA71091@freebsd.org> References: <20110308173909.GA71091@freebsd.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/.f9CZSRiiLlpgGTMd/fMb3X"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: current@freebsd.org Subject: Re: [TESTING]: one more boot2 shrinking patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 20:43:14 -0000 --Sig_/.f9CZSRiiLlpgGTMd/fMb3X Content-Type: multipart/mixed; boundary="MP_/65dpXQf2oXB/a7fO=j/E701" --MP_/65dpXQf2oXB/a7fO=j/E701 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Roman Divacky wrote: > this diet patch=20 >=20 > http://lev.vlakno.cz/~rdivacky/boot2-final-diet.patch >=20 > includes these changes: >=20 > o bunch of variables are turned into uint8_t=20 >=20 > o initial setting of namep[] in lookup() is removed > as it's only overwritten a few lines down >=20 > o kname is explicitly initialized in main() as BSS > in boot2 is not zeroed Are you saying the previous: static const char *kname =3D NULL; didn't work, or is this the explanation why the initialization hasn't simply been removed? > o the "fmt" dance in load() is removed >=20 > o buf in printf() is made static to save space >=20 >=20 > Please test/review this patch. John Baldwin already looked and I booted > it so it should be quite safe. I plan to commit this in a few days unless > problems are found.. Works for me with gcc from base on amd64. I noticed an unrelated warning about an unused variable, though. /usr/src/sys/boot/i386/boot2/boot2.c: In function 'load': /usr/src/sys/boot/i386/boot2/boot2.c:310: warning: unused variable 'x' It seems to be left over from: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/boot/i386/boot2/boot2.c.diff?= r1=3D1.91;r2=3D1.92;f=3Dh The attached (only compile-tested) patch removes it. Fabian --MP_/65dpXQf2oXB/a7fO=j/E701 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-Remove-unused-variable-x-in-load.patch =46rom 92e87c9a0daf786790ed1f50143a428f2df5ad97 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 8 Mar 2011 20:59:20 +0100 Subject: [PATCH] Remove unused variable x in load() --- sys/boot/i386/boot2/boot2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index 5cdb818..a0aa3f1 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -307,7 +307,7 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; =20 if (!(ino =3D lookup(kname))) { --=20 1.7.4.1 --MP_/65dpXQf2oXB/a7fO=j/E701-- --Sig_/.f9CZSRiiLlpgGTMd/fMb3X Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iEYEARECAAYFAk12j10ACgkQBYqIVf93VJ1TfQCfdJUxkyiReC/UuCDx5/0T0TxO naEAn3fY+hG70snsEO/RdPs/v614VyR5 =/xXz -----END PGP SIGNATURE----- --Sig_/.f9CZSRiiLlpgGTMd/fMb3X--