-/* $OpenBSD: acpibat.c,v 1.50 2008/06/13 05:50:21 jordan Exp $ */
+/* $OpenBSD: acpibat.c,v 1.51 2008/08/05 17:01:06 marco Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
struct aml_value res;
int rv = EINVAL;
- memset(&sc->sc_bif, 0, sizeof(sc->sc_bif));
- if (!sc->sc_bat_present)
- return 0;
+ if (!sc->sc_bat_present) {
+ memset(&sc->sc_bif, 0, sizeof(sc->sc_bif));
+ return (0);
+ }
if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "_BIF", 0, NULL, &res)) {
dnprintf(10, "%s: no _BIF\n", DEVNAME(sc));
struct aml_value res;
int rv = EINVAL;
- memset(&sc->sc_bst, 0, sizeof(sc->sc_bst));
- if (!sc->sc_bat_present)
- return 0;
+ if (!sc->sc_bat_present) {
+ memset(&sc->sc_bst, 0, sizeof(sc->sc_bst));
+ return (0);
+ }
if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "_BST", 0, NULL, &res)) {
dnprintf(10, "%s: no _BST\n", DEVNAME(sc));
acpibat_notify(struct aml_node *node, int notify_type, void *arg)
{
struct acpibat_softc *sc = arg;
- struct aml_value res;
+ struct aml_value res;
+ int present
dnprintf(10, "acpibat_notify: %.2x %s\n", notify_type,
sc->sc_devnode->name);
/* Check if installed state of battery has changed */
memset(&res, 0, sizeof(res));
if (aml_evalname(sc->sc_acpi, node, "_STA", 0, NULL, &res) == 0) {
- int present = (res.v_integer & STA_BATTERY);
-
+ present = res.v_integer & STA_BATTERY;
if (!sc->sc_bat_present && present) {
printf("%s: %s inserted\n", DEVNAME(sc),
sc->sc_devnode->name);