1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Simplify retry loops. No functional change.

This commit is contained in:
Jung-uk Kim 2015-01-23 18:55:04 +00:00
parent 4552fccb4b
commit ae1ef64fe4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=277594

View File

@ -645,10 +645,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;
@ -963,15 +961,13 @@ EcRead(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data)
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);