Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Mar 2011 21:19:31 +0100
From:      Fabian Keil <freebsd-listen@fabiankeil.de>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: [TESTING]: one more boot2 shrinking patch
Message-ID:  <20110308211931.1c5deb8b@r500.local>
In-Reply-To: <20110308173909.GA71091@freebsd.org>
References:  <20110308173909.GA71091@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <rdivacky@freebsd.org> 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 <fk@fabiankeil.de>
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110308211931.1c5deb8b>