ACPI: Avoid discarding a potential error value.
This is part of a new diagnostic I've managed to wire up that finds all instances of "status_t" function return values being discarded using attribute trickery and some creative Clang pragmas. As you might guess, the resultant errors list is absolutely gigantic, and most of them are ones where the failure condition will never (that we care about) be hit. The ones in this commit likely are no-op changes, but they were low-hanging fruit spotted while reviewing the larger list. The next commit will bring more substantial changes.
This commit is contained in:
@@ -772,10 +772,9 @@ AcpiOsRemoveInterruptHandler(UINT32 interruptNumber,
|
|||||||
DEBUG_FUNCTION_F("vector: %lu; handler: %p", (uint32)interruptNumber,
|
DEBUG_FUNCTION_F("vector: %lu; handler: %p", (uint32)interruptNumber,
|
||||||
serviceRoutine);
|
serviceRoutine);
|
||||||
#ifdef _KERNEL_MODE
|
#ifdef _KERNEL_MODE
|
||||||
remove_io_interrupt_handler(interruptNumber,
|
return remove_io_interrupt_handler(interruptNumber,
|
||||||
(interrupt_handler) serviceRoutine,
|
(interrupt_handler)serviceRoutine,
|
||||||
sInterruptHandlerData[interruptNumber]);
|
sInterruptHandlerData[interruptNumber]) == B_OK ? AE_OK : AE_ERROR;
|
||||||
return AE_OK;
|
|
||||||
#else
|
#else
|
||||||
return AE_ERROR;
|
return AE_ERROR;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -188,15 +188,13 @@ static status_t
|
|||||||
EcLock(struct acpi_ec_cookie *sc)
|
EcLock(struct acpi_ec_cookie *sc)
|
||||||
{
|
{
|
||||||
/* If _GLK is non-zero, acquire the global lock. */
|
/* If _GLK is non-zero, acquire the global lock. */
|
||||||
status_t status = B_OK;
|
|
||||||
if (sc->ec_glk) {
|
if (sc->ec_glk) {
|
||||||
status = sc->ec_acpi_module->acquire_global_lock(EC_LOCK_TIMEOUT,
|
status_t status = sc->ec_acpi_module->acquire_global_lock(EC_LOCK_TIMEOUT,
|
||||||
&sc->ec_glkhandle);
|
&sc->ec_glkhandle);
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
mutex_lock(&sc->ec_lock);
|
return mutex_lock(&sc->ec_lock);
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user