Module Name: src Committed By: jruoho Date: Thu Apr 8 12:36:21 UTC 2010
Modified Files: src/sys/dev/acpi/wmi: wmi_acpi.c wmi_acpivar.h Log Message: Semantics. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/wmi/wmi_acpi.c \ src/sys/dev/acpi/wmi/wmi_acpivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/wmi/wmi_acpi.c diff -u src/sys/dev/acpi/wmi/wmi_acpi.c:1.1 src/sys/dev/acpi/wmi/wmi_acpi.c:1.2 --- src/sys/dev/acpi/wmi/wmi_acpi.c:1.1 Thu Apr 8 12:14:19 2010 +++ src/sys/dev/acpi/wmi/wmi_acpi.c Thu Apr 8 12:36:21 2010 @@ -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 <jruoho...@iki.fi> @@ -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) Index: src/sys/dev/acpi/wmi/wmi_acpivar.h diff -u src/sys/dev/acpi/wmi/wmi_acpivar.h:1.1 src/sys/dev/acpi/wmi/wmi_acpivar.h:1.2 --- src/sys/dev/acpi/wmi/wmi_acpivar.h:1.1 Thu Apr 8 12:14:19 2010 +++ src/sys/dev/acpi/wmi/wmi_acpivar.h Thu Apr 8 12:36:21 2010 @@ -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 <jruoho...@iki.fi> @@ -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 */