diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-01-17 17:17:12 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-01-17 17:17:12 +0000 |
commit | 9937f305311544c3b90c189b9e0fb999ba717306 (patch) | |
tree | ca8f78552c9c29bc0f7f86bf7135a9c1812b63f7 /sys/dev/acpi | |
parent | dad55f14f79438635b953b729c55add8921be7db (diff) |
A couple of stray malloc/memset -> malloc(M_ZERO), a bit of knf and
lose a couple of unnecessary casts. No functional change.
Feedback from kettenis@
ok kettenis@ marco@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/acpi.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 9220ba14c92..7530d3e98ff 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.126 2008/11/06 23:41:28 marco Exp $ */ +/* $OpenBSD: acpi.c,v 1.127 2009/01/17 17:17:11 krw Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -1434,19 +1434,17 @@ acpi_foundprw(struct aml_node *node, void *arg) struct acpi_softc *sc = arg; struct acpi_wakeq *wq; - wq = (struct acpi_wakeq *)malloc(sizeof(struct acpi_wakeq), M_DEVBUF, M_NOWAIT); + wq = malloc(sizeof(struct acpi_wakeq), M_DEVBUF, M_NOWAIT | M_ZERO); if (wq == NULL) { return 0; } - memset(wq, 0, sizeof(struct acpi_wakeq)); - wq->q_wakepkg = (struct aml_value *)malloc(sizeof(struct aml_value), - M_DEVBUF, M_NOWAIT); + wq->q_wakepkg = malloc(sizeof(struct aml_value), M_DEVBUF, + M_NOWAIT | M_ZERO); if (wq->q_wakepkg == NULL) { free(wq, M_DEVBUF); return 0; } - memset(wq->q_wakepkg, 0, sizeof(struct aml_value)); dnprintf(10, "Found _PRW (%s)\n", node->parent->name); aml_evalnode(sc, node, 0, NULL, wq->q_wakepkg); wq->q_node = node->parent; |