summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-12 21:58:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-12 21:58:44 +0000
commit13788c28c919a9321717923e63b8d35c0e3178be (patch)
treef51dd2ffe0e61f796d7fea699599dd280c356645
parent0ddea1474c77c2b6e13ae528061c4813f7242a28 (diff)
spacing
-rw-r--r--sys/dev/acpi/acpibat.c4
-rw-r--r--sys/dev/acpi/acpicpu.c12
-rw-r--r--sys/dev/acpi/acpidebug.c15
-rw-r--r--sys/dev/acpi/acpidev.h10
-rw-r--r--sys/dev/acpi/acpidock.c11
-rw-r--r--sys/dev/acpi/acpiprt.c6
-rw-r--r--sys/dev/acpi/acpivar.h72
7 files changed, 63 insertions, 67 deletions
diff --git a/sys/dev/acpi/acpibat.c b/sys/dev/acpi/acpibat.c
index 219b27cf0d1..bd41666297b 100644
--- a/sys/dev/acpi/acpibat.c
+++ b/sys/dev/acpi/acpibat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibat.c,v 1.44 2007/11/12 19:55:37 deraadt Exp $ */
+/* $OpenBSD: acpibat.c,v 1.45 2007/11/12 21:58:13 deraadt Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -272,7 +272,7 @@ acpibat_refresh(void *arg)
sc->sc_sens[6].status = SENSOR_S_OK;
}
- if(sc->sc_bst.bst_voltage == BST_UNKNOWN) {
+ if (sc->sc_bst.bst_voltage == BST_UNKNOWN) {
sc->sc_sens[7].value = 0;
sc->sc_sens[7].status = SENSOR_S_UNKNOWN;
sc->sc_sens[7].flags = SENSOR_FUNKNOWN;
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index 5f302e5605c..a449dc932af 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.30 2007/11/12 19:55:46 deraadt Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.31 2007/11/12 21:58:14 deraadt Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -101,9 +101,9 @@ struct acpicpu_softc {
* PPC changes can occur when for example a machine is disconnected
* from AC power and can no loger support the highest frequency or
* voltage when driven from the battery.
- * Should probably be reimplemented as a list for now we assume only
+ * Should probably be reimplemented as a list for now we assume only
* one listener */
- void (*sc_notify)(struct acpicpu_pss *, int);
+ void (*sc_notify)(struct acpicpu_pss *, int);
};
void acpicpu_set_throttle(struct acpicpu_softc *, int);
@@ -263,7 +263,7 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
printf(": %s: ", sc->sc_devnode->name);
printf("\n: hdr:%x pblk:%x,%x duty:%x,%x pstate:%x (%d throttling states)\n",
sc->sc_acpi->sc_fadt->hdr_revision,
- sc->sc_pblk_addr, sc->sc_pblk_len,
+ sc->sc_pblk_addr, sc->sc_pblk_len,
sc->sc_duty_off, sc->sc_duty_wid,
sc->sc_acpi->sc_fadt->pstate_cnt,
CPU_MAXSTATE(sc));
@@ -325,7 +325,7 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
}
}
- /*
+ /*
* Nicely enumerate what power management capabilities
* ACPI CPU provides.
*/
@@ -334,7 +334,7 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
SLIST_FOREACH(cx, &sc->sc_cstates, link) {
if (i)
printf(",");
- switch(cx->type) {
+ switch (cx->type) {
case ACPI_STATE_C0:
printf(" C0");
break;
diff --git a/sys/dev/acpi/acpidebug.c b/sys/dev/acpi/acpidebug.c
index 795837bd8de..0a80d43b0cd 100644
--- a/sys/dev/acpi/acpidebug.c
+++ b/sys/dev/acpi/acpidebug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidebug.c,v 1.15 2007/02/06 18:56:31 jordan Exp $ */
+/* $OpenBSD: acpidebug.c,v 1.16 2007/11/12 21:58:14 deraadt Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@openbsd.org>
*
@@ -477,8 +477,7 @@ db_aml_disasm(struct aml_node *root, uint8_t *start, uint8_t *end,
name = aml_parsename(scope);
node = aml_searchname(scope->node, name);
db_aml_disline(pos, depth+off, "%s <%s>\n",
- aml_getname(name),
- aml_nodename(node));
+ aml_getname(name), aml_nodename(node));
if (!node || !node->value ||
node->value->type != AML_OBJTYPE_METHOD)
@@ -486,8 +485,8 @@ db_aml_disasm(struct aml_node *root, uint8_t *start, uint8_t *end,
/* Method calls */
for (idx = 0;
- idx < AML_METHOD_ARGCOUNT(node->value->v_method.flags);
- idx++) {
+ idx < AML_METHOD_ARGCOUNT(node->value->v_method.flags);
+ idx++) {
scope->pos = db_aml_disasm(node, scope->pos,
scope->end, 1, depth+1);
}
@@ -514,7 +513,7 @@ db_aml_disasm(struct aml_node *root, uint8_t *start, uint8_t *end,
snprintf(tmpstr+idx*6, 7, "0x%.2x, ",
scope->pos[idx]);
db_aml_disline(pos, depth+1, "ByteList <%s>\n", tmpstr);
- free(tmpstr, M_DEVBUF);
+ free(tmpstr, M_DEVBUF);
scope->pos = end;
break;
case 'F':
@@ -528,12 +527,12 @@ db_aml_disasm(struct aml_node *root, uint8_t *start, uint8_t *end,
len = aml_parselength(scope);
db_aml_disline(pos, depth+1,
"Reserved\t%.4x,%.4x\n",
- off, len);
+ off, len);
break;
case 0x01: // attr
db_aml_disline(pos, depth+1,
"Attr:%.2x,%.2x\n",
- scope->pos[1], scope->pos[2]);
+ scope->pos[1], scope->pos[2]);
scope->pos += 3;
break;
default:
diff --git a/sys/dev/acpi/acpidev.h b/sys/dev/acpi/acpidev.h
index 8fa10c879bb..b786e0230c9 100644
--- a/sys/dev/acpi/acpidev.h
+++ b/sys/dev/acpi/acpidev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidev.h,v 1.25 2007/05/31 17:49:16 gwk Exp $ */
+/* $OpenBSD: acpidev.h,v 1.26 2007/11/12 21:58:14 deraadt Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
@@ -64,10 +64,10 @@ struct acpibat_bif {
u_int32_t bif_low;
u_int32_t bif_cap_granu1;
u_int32_t bif_cap_granu2;
- char bif_model[20];
- char bif_serial[20];
- char bif_type[20];
- char bif_oem[20];
+ char bif_model[20];
+ char bif_serial[20];
+ char bif_type[20];
+ char bif_oem[20];
};
/*
diff --git a/sys/dev/acpi/acpidock.c b/sys/dev/acpi/acpidock.c
index e92827c255b..4103e40fbc0 100644
--- a/sys/dev/acpi/acpidock.c
+++ b/sys/dev/acpi/acpidock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidock.c,v 1.26 2007/09/13 03:43:22 weingart Exp $ */
+/* $OpenBSD: acpidock.c,v 1.27 2007/11/12 21:58:14 deraadt Exp $ */
/*
* Copyright (c) 2006,2007 Michael Knudsen <mk@openbsd.org>
*
@@ -45,7 +45,6 @@ struct cfdriver acpidock_cd = {
NULL, "acpidock", DV_DULL
};
-
int acpidock_docklock(struct acpidock_softc *, int);
int acpidock_dockctl(struct acpidock_softc *, int);
int acpidock_eject(struct acpidock_softc *, struct aml_node *);
@@ -112,9 +111,8 @@ acpidock_attach(struct device *parent, struct device *self, void *aux)
TAILQ_INIT(&sc->sc_deps_h);
aml_find_node(aml_root.child, "_EJD", acpidock_foundejd, sc);
- aml_register_notify(sc->sc_devnode->parent, aa->aaa_dev,
+ aml_register_notify(sc->sc_devnode->parent, aa->aaa_dev,
acpidock_notify, sc, ACPIDEV_NOPOLL);
-
}
int
@@ -128,7 +126,7 @@ acpidock_status(struct acpidock_softc *sc)
rv = 0;
else
rv = 1;
-
+
sc->sc_sta = aml_val2int(&res);
sc->sc_docked = sc->sc_sta & STA_PRESENT;
@@ -246,7 +244,7 @@ acpidock_notify(struct aml_node *node, int notify_type, void *arg)
acpidock_eject(sc, sc->sc_devnode);
printf("%s: undock", DEVNAME(sc));
-
+
break;
}
}
@@ -284,7 +282,6 @@ acpidock_foundejd(struct aml_node *node, void *arg)
node->parent->name, res.v_string);
/* XXX more than one dock? */
-
n = malloc(sizeof(struct aml_nodelist), M_DEVBUF, M_WAITOK);
n->node = node->parent;
diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c
index 66eca945092..187475bb603 100644
--- a/sys/dev/acpi/acpiprt.c
+++ b/sys/dev/acpi/acpiprt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpiprt.c,v 1.19 2007/11/12 21:38:31 deraadt Exp $ */
+/* $OpenBSD: acpiprt.c,v 1.20 2007/11/12 21:58:14 deraadt Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
@@ -290,8 +290,8 @@ acpiprt_getpcibus(struct acpiprt_softc *sc, struct aml_node *node)
*/
if (aml_evalname(sc->sc_acpi, parent, "_CRS.", 0, NULL, &res) == 0) {
rv = -1;
- if (res.type == AML_OBJTYPE_BUFFER)
- aml_parse_resource(res.length, res.v_buffer,
+ if (res.type == AML_OBJTYPE_BUFFER)
+ aml_parse_resource(res.length, res.v_buffer,
acpiprt_getminbus, &rv);
aml_freevalue(&res);
if (rv != -1)
diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h
index a1d7ea8f4a6..a05c2d1828e 100644
--- a/sys/dev/acpi/acpivar.h
+++ b/sys/dev/acpi/acpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivar.h,v 1.37 2007/11/03 20:33:48 jordan Exp $ */
+/* $OpenBSD: acpivar.h,v 1.38 2007/11/12 21:58:43 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -60,43 +60,42 @@ struct acpi_q {
};
struct acpi_wakeq {
- SIMPLEQ_ENTRY(acpi_wakeq) q_next;
- struct aml_node *q_node;
- struct aml_value *q_wakepkg;
- int q_gpe;
- int q_state;
+ SIMPLEQ_ENTRY(acpi_wakeq) q_next;
+ struct aml_node *q_node;
+ struct aml_value *q_wakepkg;
+ int q_gpe;
+ int q_state;
};
typedef SIMPLEQ_HEAD(, acpi_q) acpi_qhead_t;
typedef SIMPLEQ_HEAD(, acpi_wakeq) acpi_wakeqhead_t;
-#define ACPIREG_PM1A_STS 0x00
-#define ACPIREG_PM1A_EN 0x01
-#define ACPIREG_PM1A_CNT 0x02
-#define ACPIREG_PM1B_STS 0x03
-#define ACPIREG_PM1B_EN 0x04
-#define ACPIREG_PM1B_CNT 0x05
-#define ACPIREG_PM2_CNT 0x06
-#define ACPIREG_PM_TMR 0x07
-#define ACPIREG_GPE0_STS 0x08
-#define ACPIREG_GPE0_EN 0x09
-#define ACPIREG_GPE1_STS 0x0A
-#define ACPIREG_GPE1_EN 0x0B
-#define ACPIREG_SMICMD 0x0C
-#define ACPIREG_MAXREG 0x0D
+#define ACPIREG_PM1A_STS 0x00
+#define ACPIREG_PM1A_EN 0x01
+#define ACPIREG_PM1A_CNT 0x02
+#define ACPIREG_PM1B_STS 0x03
+#define ACPIREG_PM1B_EN 0x04
+#define ACPIREG_PM1B_CNT 0x05
+#define ACPIREG_PM2_CNT 0x06
+#define ACPIREG_PM_TMR 0x07
+#define ACPIREG_GPE0_STS 0x08
+#define ACPIREG_GPE0_EN 0x09
+#define ACPIREG_GPE1_STS 0x0A
+#define ACPIREG_GPE1_EN 0x0B
+#define ACPIREG_SMICMD 0x0C
+#define ACPIREG_MAXREG 0x0D
/* Special registers */
-#define ACPIREG_PM1_STS 0x0E
-#define ACPIREG_PM1_EN 0x0F
-#define ACPIREG_PM1_CNT 0x10
-#define ACPIREG_GPE_STS 0x11
-#define ACPIREG_GPE_EN 0x12
-
-struct acpi_parsestate
-{
- u_int8_t *start;
- u_int8_t *end;
- u_int8_t *pos;
+#define ACPIREG_PM1_STS 0x0E
+#define ACPIREG_PM1_EN 0x0F
+#define ACPIREG_PM1_CNT 0x10
+#define ACPIREG_GPE_STS 0x11
+#define ACPIREG_GPE_EN 0x12
+
+struct acpi_parsestate {
+ u_int8_t *start;
+ u_int8_t *end;
+ u_int8_t *pos;
};
struct acpi_reg_map {
@@ -154,8 +153,8 @@ struct acpi_softc {
* First-level ACPI tables
*/
struct acpi_fadt *sc_fadt;
- acpi_qhead_t sc_tables;
- acpi_wakeqhead_t sc_wakedevs;
+ acpi_qhead_t sc_tables;
+ acpi_wakeqhead_t sc_wakedevs;
/*
* Second-level information from FADT
@@ -181,9 +180,9 @@ struct acpi_softc {
int slp_typb;
} sc_sleeptype[6];
int sc_maxgpe;
- int sc_lastgpe;
+ int sc_lastgpe;
- struct gpe_block *gpe_table;
+ struct gpe_block *gpe_table;
int sc_wakeup;
u_int32_t sc_gpe_sts;
@@ -249,7 +248,8 @@ void acpi_resume(struct acpi_softc *);
void acpi_delay(struct acpi_softc *, int64_t);
int acpi_gasio(struct acpi_softc *, int, int, uint64_t, int, int, void *);
-int acpi_set_gpehandler(struct acpi_softc *, int, int (*)(struct acpi_softc *, int, void *), void *, const char *);
+int acpi_set_gpehandler(struct acpi_softc *, int,
+ int (*)(struct acpi_softc *, int, void *), void *, const char *);
void acpi_enable_gpe(struct acpi_softc *, u_int32_t);
int acpiec_intr(struct acpiec_softc *);