Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi/wmi Semantics.
details: https://anonhg.NetBSD.org/src/rev/6babb32d033f
branches: trunk
changeset: 753733:6babb32d033f
user: jruoho <jruoho%NetBSD.org@localhost>
date: Thu Apr 08 12:36:21 2010 +0000
description:
Semantics.
diffstat:
sys/dev/acpi/wmi/wmi_acpi.c | 16 +++++++++-------
sys/dev/acpi/wmi/wmi_acpivar.h | 10 +++++-----
2 files changed, 14 insertions(+), 12 deletions(-)
diffs (95 lines):
diff -r 36eb1ca15906 -r 6babb32d033f sys/dev/acpi/wmi/wmi_acpi.c
--- a/sys/dev/acpi/wmi/wmi_acpi.c Thu Apr 08 12:14:19 2010 +0000
+++ b/sys/dev/acpi/wmi/wmi_acpi.c Thu Apr 08 12:36:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wmi_acpi.c,v 1.1 2010/04/08 12:14:19 jruoho Exp $ */
+/* $NetBSD: wmi_acpi.c,v 1.2 2010/04/08 12:36:21 jruoho Exp $ */
/*-
* Copyright (c) 2009, 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.1 2010/04/08 12:14:19 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.2 2010/04/08 12:36:21 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -302,7 +302,7 @@
{
struct wmi_t *wmi;
- if (SIMPLEQ_EMPTY(&sc->wmi_head))
+ if (SIMPLEQ_EMPTY(&sc->wmi_head) != 0)
return;
while (SIMPLEQ_FIRST(&sc->wmi_head) != NULL) {
@@ -362,7 +362,7 @@
(void)memcpy(hex, ptr, 2);
- if (!HEXCHAR(hex[0]) || !HEXCHAR(hex[1]))
+ if (HEXCHAR(hex[0]) == 0 || HEXCHAR(hex[1]) == 0)
return AE_BAD_HEX_CONSTANT;
bin[i] = strtoul(hex, NULL, 16) & 0xFF;
@@ -499,6 +499,9 @@
struct wmi_t *wmi;
ACPI_OBJECT_LIST arg;
ACPI_OBJECT obj;
+ ACPI_HANDLE hdl;
+
+ hdl = sc->sc_node->ad_handle;
if (sc == NULL || obuf == NULL)
return AE_BAD_PARAMETER;
@@ -523,8 +526,7 @@
if (wmi->guid.nid != event)
continue;
- return AcpiEvaluateObject(sc->sc_node->ad_handle, "_WED",
- &arg, obuf);
+ return AcpiEvaluateObject(hdl, "_WED", &arg, obuf);
}
return AE_NOT_FOUND;
@@ -615,7 +617,7 @@
acpi_wmi_input(struct wmi_t *wmi, uint8_t flag, uint8_t idx)
{
- if (!(wmi->guid.flags & flag))
+ if ((wmi->guid.flags & flag) == 0)
return false;
if (wmi->guid.count == 0x00)
diff -r 36eb1ca15906 -r 6babb32d033f sys/dev/acpi/wmi/wmi_acpivar.h
--- a/sys/dev/acpi/wmi/wmi_acpivar.h Thu Apr 08 12:14:19 2010 +0000
+++ b/sys/dev/acpi/wmi/wmi_acpivar.h Thu Apr 08 12:36:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wmi_acpivar.h,v 1.1 2010/04/08 12:14:19 jruoho Exp $ */
+/* $NetBSD: wmi_acpivar.h,v 1.2 2010/04/08 12:36:21 jruoho Exp $ */
/*-
* Copyright (c) 2009, 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,11 +27,11 @@
* SUCH DAMAGE.
*/
-#ifndef _SYS_DEV_ACPI_WMI_ACPIVAR_H
-#define _SYS_DEV_ACPI_WMI_ACPIVAR_H
+#ifndef _SYS_DEV_ACPI_WMI_WMI_ACPIVAR_H
+#define _SYS_DEV_ACPI_WMI_WMI_ACPIVAR_H
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wmi_acpivar.h,v 1.1 2010/04/08 12:14:19 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_acpivar.h,v 1.2 2010/04/08 12:36:21 jruoho Exp $");
ACPI_STATUS acpi_wmi_event_register(device_t, ACPI_NOTIFY_HANDLER);
ACPI_STATUS acpi_wmi_event_deregister(device_t);
@@ -47,4 +47,4 @@
ACPI_STATUS acpi_wmi_method(device_t, const char *, uint8_t,
uint32_t, ACPI_BUFFER *, ACPI_BUFFER *);
-#endif /* !_SYS_DEV_ACPI_WMI_ACPIVAR_H */
+#endif /* !_SYS_DEV_ACPI_WMI_WMI_ACPIVAR_H */
Home |
Main Index |
Thread Index |
Old Index