Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2012 21:33:33 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r236424 - in head/sys: amd64/acpica dev/acpica dev/acpica/Osd i386/acpica
Message-ID:  <201206012133.q51LXXuI045164@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Fri Jun  1 21:33:33 2012
New Revision: 236424
URL: http://svn.freebsd.org/changeset/base/236424

Log:
  Consistently use ACPI_SUCCESS() and ACPI_FAILURE() macros wherever possible.

Modified:
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/dev/acpica/Osd/OsdSynch.c
  head/sys/dev/acpica/acpi_ec.c
  head/sys/dev/acpica/acpivar.h
  head/sys/i386/acpica/acpi_wakeup.c

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==============================================================================
--- head/sys/amd64/acpica/acpi_wakeup.c	Fri Jun  1 21:29:26 2012	(r236423)
+++ head/sys/amd64/acpica/acpi_wakeup.c	Fri Jun  1 21:33:33 2012	(r236424)
@@ -263,8 +263,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
 			status = AcpiEnterSleepStateS4bios();
 		else
 			status = AcpiEnterSleepState(state, acpi_sleep_flags);
-
-		if (status != AE_OK) {
+		if (ACPI_FAILURE(status)) {
 			device_printf(sc->acpi_dev,
 			    "AcpiEnterSleepState failed - %s\n",
 			    AcpiFormatException(status));

Modified: head/sys/dev/acpica/Osd/OsdSynch.c
==============================================================================
--- head/sys/dev/acpica/Osd/OsdSynch.c	Fri Jun  1 21:29:26 2012	(r236423)
+++ head/sys/dev/acpica/Osd/OsdSynch.c	Fri Jun  1 21:33:33 2012	(r236424)
@@ -208,7 +208,7 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handl
 			tmo -= slptick;
 		}
 	}
-	if (status == AE_OK)
+	if (ACPI_SUCCESS(status))
 		as->as_units -= Units;
 
 	mtx_unlock(&as->as_lock);
@@ -402,7 +402,7 @@ AcpiOsAcquireMutex(ACPI_MUTEX Handle, UI
 			tmo -= slptick;
 		}
 	}
-	if (status == AE_OK)
+	if (ACPI_SUCCESS(status))
 		am->am_owner = curthread;
 
 	mtx_unlock(&am->am_lock);

Modified: head/sys/dev/acpica/acpi_ec.c
==============================================================================
--- head/sys/dev/acpica/acpi_ec.c	Fri Jun  1 21:29:26 2012	(r236423)
+++ head/sys/dev/acpica/acpi_ec.c	Fri Jun  1 21:33:33 2012	(r236424)
@@ -649,8 +649,8 @@ EcGpeQueryHandler(void *Context)
 	Status = EcCommand(sc, EC_COMMAND_QUERY);
 	if (ACPI_SUCCESS(Status))
 	    break;
-	if (EcCheckStatus(sc, "retr_check",
-	    EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK)
+	if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check",
+	    EC_EVENT_INPUT_BUFFER_EMPTY)))
 	    continue;
 	else
 	    break;
@@ -845,7 +845,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC
 	DELAY(10);
 	for (i = 0; i < count; i++) {
 	    Status = EcCheckStatus(sc, "poll", Event);
-	    if (Status == AE_OK)
+	    if (ACPI_SUCCESS(Status))
 		break;
 	    DELAY(EC_POLL_DELAY);
 	}
@@ -875,7 +875,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC
 	     * event we are actually waiting for.
 	     */
 	    Status = EcCheckStatus(sc, "sleep", Event);
-	    if (Status == AE_OK) {
+	    if (ACPI_SUCCESS(Status)) {
 		if (gen_count == sc->ec_gencount)
 		    no_intr++;
 		else
@@ -890,7 +890,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC
 	 * read the register once and trust whatever value we got.  This is
 	 * the best we can do at this point.
 	 */
-	if (Status != AE_OK)
+	if (ACPI_FAILURE(Status))
 	    Status = EcCheckStatus(sc, "sleep_end", Event);
     }
     if (!need_poll && no_intr > 10) {
@@ -898,7 +898,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC
 	    "not getting interrupts, switched to polled mode\n");
 	ec_polled_mode = 1;
     }
-    if (Status != AE_OK)
+    if (ACPI_FAILURE(Status))
 	    CTR0(KTR_ACPI, "error: ec wait timed out");
     return (Status);
 }
@@ -977,8 +977,8 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A
 	EC_SET_DATA(sc, Address);
 	status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count);
 	if (ACPI_FAILURE(status)) {
-	    if (EcCheckStatus(sc, "retr_check",
-		EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK)
+	    if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check",
+		EC_EVENT_INPUT_BUFFER_EMPTY)))
 		continue;
 	    else
 		break;

Modified: head/sys/dev/acpica/acpivar.h
==============================================================================
--- head/sys/dev/acpica/acpivar.h	Fri Jun  1 21:29:26 2012	(r236423)
+++ head/sys/dev/acpica/acpivar.h	Fri Jun  1 21:33:33 2012	(r236424)
@@ -273,7 +273,7 @@ acpi_get_type(device_t dev)
 
     if ((h = acpi_get_handle(dev)) == NULL)
 	return (ACPI_TYPE_NOT_FOUND);
-    if (AcpiGetType(h, &t) != AE_OK)
+    if (ACPI_FAILURE(AcpiGetType(h, &t)))
 	return (ACPI_TYPE_NOT_FOUND);
     return (t);
 }

Modified: head/sys/i386/acpica/acpi_wakeup.c
==============================================================================
--- head/sys/i386/acpica/acpi_wakeup.c	Fri Jun  1 21:29:26 2012	(r236423)
+++ head/sys/i386/acpica/acpi_wakeup.c	Fri Jun  1 21:33:33 2012	(r236424)
@@ -249,8 +249,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
 			status = AcpiEnterSleepStateS4bios();
 		else
 			status = AcpiEnterSleepState(state, acpi_sleep_flags);
-
-		if (status != AE_OK) {
+		if (ACPI_FAILURE(status)) {
 			device_printf(sc->acpi_dev,
 			    "AcpiEnterSleepState failed - %s\n",
 			    AcpiFormatException(status));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206012133.q51LXXuI045164>