NetBSD Problem Report #41179

From jruohone@gmail.com  Fri Apr 10 03:35:35 2009
Return-Path: <jruohone@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 37D9B63BC38
	for <gnats-bugs@gnats.netbsd.org>; Fri, 10 Apr 2009 03:35:35 +0000 (UTC)
Message-Id: <20090409143613.CD52F2880@marx.bitnet>
Date: Thu,  9 Apr 2009 17:36:13 +0300 (EEST)
From: Jukka Ruohonen <jruohonen@iki.fi>
Sender: a b <jruohone@gmail.com>
Reply-To: jruohonen@iki.fi
To: gnats-bugs@gnats.NetBSD.org
Subject: Incorrect return values from AcpiOsExecute()
X-Send-Pr-Version: 3.95

>Number:         41179
>Category:       kern
>Synopsis:       Incorrect return values from AcpiOsExecute()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jmcneill
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 10 03:40:00 +0000 2009
>Closed-Date:    Tue Aug 25 10:34:28 +0000 2009
>Last-Modified:  Tue Aug 25 10:35:01 +0000 2009
>Originator:     Jukka Ruohonen
>Release:        NetBSD 5.99.8
>Organization:
-
>Environment:
NetBSD 5.99.8
>Description:

This goes to the trivia-section; as we have an API, we may as well follow it
(see below).

>How-To-Repeat:
	-
>Fix:

Index: acpi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.123
diff -u -p -r1.123 acpi.c
--- acpi.c	30 Jan 2009 12:51:03 -0000	1.123
+++ acpi.c	4 Apr 2009 12:33:15 -0000
@@ -972,7 +972,7 @@
 acpi_fixed_button_handler(void *context)
 {
 	struct sysmon_pswitch *smpsw = context;
-	int rv;
+	ACPI_STATUS rv;

 #ifdef ACPI_BUT_DEBUG
 	printf("%s: fixed button handler\n", smpsw->smpsw_name);

Index: acpi_acad.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_acad.c,v
retrieving revision 1.33
diff -u -p -r1.33 acpi_acad.c
--- acpi_acad.c	23 Mar 2008 18:38:57 -0000	1.33
+++ acpi_acad.c	4 Apr 2009 12:23:57 -0000
@@ -239,7 +239,7 @@ acpiacad_notify_handler(ACPI_HANDLE hand
 {
 	device_t dv = context;
 	struct acpiacad_softc *sc = device_private(dv);
-	int rv;
+	ACPI_STATUS rv;

 	switch (notify) {
 	/*

Index: acpi_bat.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_bat.c,v
retrieving revision 1.69
diff -u -p -r1.69 acpi_bat.c
--- acpi_bat.c	3 Jun 2008 15:02:31 -0000	1.69
+++ acpi_bat.c	4 Apr 2009 12:35:11 -0000
@@ -667,7 +667,7 @@ static void
 acpibat_notify_handler(ACPI_HANDLE handle, UINT32 notify, void *context)
 {
 	device_t dv = context;
-	int rv;
+	ACPI_STATUS rv;

 #ifdef ACPI_BAT_DEBUG
 	aprint_debug_dev(dv, "received notify message: 0x%x\n", notify);

Index: acpi_button.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_button.c,v
retrieving revision 1.25
diff -u -p -r1.25 acpi_button.c
--- acpi_button.c	9 Dec 2007 20:27:52 -0000	1.25
+++ acpi_button.c	4 Apr 2009 12:36:16 -0000
@@ -182,7 +182,7 @@ static void
 acpibut_notify_handler(ACPI_HANDLE handle, UINT32 notify, void *context)
 {
 	device_t dv = context;
-	int rv;
+	ACPI_STATUS rv;

 	switch (notify) {
 	case ACPI_NOTIFY_S0PowerButtonPressed:

Index: acpi_lid.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_lid.c,v
retrieving revision 1.26
diff -u -p -r1.26 acpi_lid.c
--- acpi_lid.c	15 Jul 2008 16:19:37 -0000	1.26
+++ acpi_lid.c	4 Apr 2009 12:37:05 -0000
@@ -206,7 +206,7 @@ acpilid_notify_handler(ACPI_HANDLE handl
 {
 	device_t dv = context;
 	struct acpilid_softc *sc = device_private(dv);
-	int rv;
+	ACPI_STATUS rv;

 	switch (notify) {
 	case ACPI_NOTIFY_LidStatusChanged:

Index: acpi_tz.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_tz.c,v
retrieving revision 1.39
diff -u -p -r1.39 acpi_tz.c
--- acpi_tz.c	9 Nov 2008 13:54:06 -0000	1.39
+++ acpi_tz.c	9 Apr 2009 14:05:03 -0000
@@ -512,7 +512,7 @@ acpitz_notify_handler(ACPI_HANDLE hdl, U
 	device_t dv = opaque;
 	ACPI_OSD_EXEC_CALLBACK func = NULL;
 	const char *name;
-	int rv;
+	ACPI_STATUS rv;

 	switch (notify) {
 	case ACPI_NOTIFY_ThermalZoneStatusChanged:
@@ -533,7 +533,7 @@ acpitz_notify_handler(ACPI_HANDLE hdl, U
 	KASSERT(func != NULL);

 	rv = AcpiOsExecute(OSL_NOTIFY_HANDLER, func, dv);
-	if (rv != AE_OK)
+	if (ACPI_FAILURE(rv))
 		aprint_debug_dev(dv, "unable to queue %s\n", name);
 }


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->jmcneill
Responsible-Changed-By: jmcneill@NetBSD.org
Responsible-Changed-When: Tue, 25 Aug 2009 10:34:28 +0000
Responsible-Changed-Why:
Mine.


State-Changed-From-To: open->closed
State-Changed-By: jmcneill@NetBSD.org
State-Changed-When: Tue, 25 Aug 2009 10:34:28 +0000
State-Changed-Why:
Patch applied, thanks!


From: "Jared D. McNeill" <jmcneill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41179 CVS commit: src/sys/dev/acpi
Date: Tue, 25 Aug 2009 10:34:08 +0000

 Module Name:	src
 Committed By:	jmcneill
 Date:		Tue Aug 25 10:34:08 UTC 2009

 Modified Files:
 	src/sys/dev/acpi: acpi.c acpi_acad.c acpi_bat.c acpi_button.c
 	    acpi_lid.c acpi_tz.c

 Log Message:
 PR# kern/41179: Incorrect return values from AcpiOsExecute()

 ACPICA functions return ACPI_STATUS instead of int, so use it for
 consistency.


 To generate a diff of this commit:
 cvs rdiff -u -r1.130 -r1.131 src/sys/dev/acpi/acpi.c
 cvs rdiff -u -r1.34 -r1.35 src/sys/dev/acpi/acpi_acad.c
 cvs rdiff -u -r1.71 -r1.72 src/sys/dev/acpi/acpi_bat.c
 cvs rdiff -u -r1.27 -r1.28 src/sys/dev/acpi/acpi_button.c \
     src/sys/dev/acpi/acpi_lid.c
 cvs rdiff -u -r1.45 -r1.46 src/sys/dev/acpi/acpi_tz.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.