- Use '*h' instead of 'struct acpi_spinlock' for sizeof[1].

- Add a missing 'else' for 'if'[2].

Requested by:	njl[1]
Submitted by:	njl[2]
This commit is contained in:
Jung-uk Kim 2007-03-26 23:04:02 +00:00
parent a80d527f45
commit abedf9eb2f

View File

@ -335,14 +335,14 @@ AcpiOsCreateLock (ACPI_SPINLOCK *OutHandle)
if (OutHandle == NULL)
return (AE_BAD_PARAMETER);
h = malloc(sizeof(struct acpi_spinlock), M_ACPISEM, M_NOWAIT | M_ZERO);
h = malloc(sizeof(*h), M_ACPISEM, M_NOWAIT | M_ZERO);
if (h == NULL)
return (AE_NO_MEMORY);
/* Build a unique name based on the address of the handle. */
if (OutHandle == &AcpiGbl_GpeLock)
snprintf(h->name, sizeof(h->name), "acpi subsystem GPE lock");
if (OutHandle == &AcpiGbl_HardwareLock)
else if (OutHandle == &AcpiGbl_HardwareLock)
snprintf(h->name, sizeof(h->name), "acpi subsystem HW lock");
else
snprintf(h->name, sizeof(h->name), "acpi subsys %p", OutHandle);