Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jan 2015 19:27:31 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r277768 - stable/10/sys/dev/acpica
Message-ID:  <201501261927.t0QJRVr3018454@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Mon Jan 26 19:27:30 2015
New Revision: 277768
URL: https://svnweb.freebsd.org/changeset/base/277768

Log:
  MFC:		r277594
  
  Simplify retry loops.

Modified:
  stable/10/sys/dev/acpica/acpi_ec.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/acpica/acpi_ec.c
==============================================================================
--- stable/10/sys/dev/acpica/acpi_ec.c	Mon Jan 26 19:25:35 2015	(r277767)
+++ stable/10/sys/dev/acpica/acpi_ec.c	Mon Jan 26 19:27:30 2015	(r277768)
@@ -648,10 +648,8 @@ EcGpeQueryHandler(void *Context)
 	Status = EcCommand(sc, EC_COMMAND_QUERY);
 	if (ACPI_SUCCESS(Status))
 	    break;
-	if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check",
+	if (ACPI_FAILURE(EcCheckStatus(sc, "retr_check",
 	    EC_EVENT_INPUT_BUFFER_EMPTY)))
-	    continue;
-	else
 	    break;
     }
     sc->ec_sci_pend = FALSE;
@@ -966,15 +964,13 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A
 	gen_count = sc->ec_gencount;
 	EC_SET_DATA(sc, Address);
 	status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count);
-	if (ACPI_FAILURE(status)) {
-	    if (ACPI_SUCCESS(EcCheckStatus(sc, "retr_check",
-		EC_EVENT_INPUT_BUFFER_EMPTY)))
-		continue;
-	    else
-		break;
+	if (ACPI_SUCCESS(status)) {
+	    *Data = EC_GET_DATA(sc);
+	    return (AE_OK);
 	}
-	*Data = EC_GET_DATA(sc);
-	return (AE_OK);
+	if (ACPI_FAILURE(EcCheckStatus(sc, "retr_check",
+	    EC_EVENT_INPUT_BUFFER_EMPTY)))
+	    break;
     }
     device_printf(sc->ec_dev, "EcRead: failed waiting to get data\n");
     return (status);



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