From e6ed3881649d3c79ad597e2f274d6369d06ddbe9 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 12 Nov 2007 04:32:38 +0000 Subject: only print bif info that is complete --- sys/dev/acpi/acpibat.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'sys/dev/acpi') diff --git a/sys/dev/acpi/acpibat.c b/sys/dev/acpi/acpibat.c index af460af32c1..21924b02d3d 100644 --- a/sys/dev/acpi/acpibat.c +++ b/sys/dev/acpi/acpibat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpibat.c,v 1.42 2007/11/08 20:27:20 canacar Exp $ */ +/* $OpenBSD: acpibat.c,v 1.43 2007/11/12 04:32:37 deraadt Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * @@ -80,12 +80,17 @@ acpibat_attach(struct device *parent, struct device *self, void *aux) if ((sc->sc_bat_present = aml_val2int(&res) & STA_BATTERY) != 0) { acpibat_getbif(sc); acpibat_getbst(sc); - printf(": %s model %s serial %s type %s oem %s\n", - sc->sc_devnode->parent->name, - sc->sc_bif.bif_model, - sc->sc_bif.bif_serial, - sc->sc_bif.bif_type, - sc->sc_bif.bif_oem); + + printf(": %s", sc->sc_devnode->parent->name); + if (sc->sc_bif.bif_model[0]) + printf(" model %s", sc->sc_bif.bif_model); + if (sc->sc_bif.bif_serial[0]) + printf(" serial %s", sc->sc_bif.bif_serial); + if (sc->sc_bif.bif_type[0]) + printf(" type %s", sc->sc_bif.bif_type); + if (sc->sc_bif.bif_oem[0]) + printf(" oem \"%s\"", sc->sc_bif.bif_oem); + printf("\n"); } else printf(": %s not present\n", sc->sc_devnode->parent->name); -- cgit v1.2.3