Re: [patch 15/15] Generic Mutex Subsystem, arch-semaphores.patch

From: Steven Rostedt
Date: Mon Dec 19 2005 - 09:34:04 EST


On Mon, 2005-12-19 at 02:40 +0100, Ingo Molnar wrote:
> Index: linux/drivers/acpi/osl.c
> ===================================================================
> --- linux.orig/drivers/acpi/osl.c
> +++ linux/drivers/acpi/osl.c
> @@ -728,14 +728,14 @@ void acpi_os_delete_lock(acpi_handle han
> acpi_status
> acpi_os_create_semaphore(u32 max_units, u32 initial_units,
> acpi_handle * handle)
> {
> - struct semaphore *sem = NULL;
> + struct arch_semaphore *sem = NULL;
>
> ACPI_FUNCTION_TRACE("os_create_semaphore");
>
> - sem = acpi_os_allocate(sizeof(struct semaphore));
> + sem = acpi_os_allocate(sizeof(struct arch_semaphore));

[OT]
This is why I prefer sizeof(*sem) over sizeof(struct type_of_sem) but I
regress. And I don't buy that argument of the mistaken sizeof(sem)
since, I've never had to deal with that bug! Oh well, each to their
own.

-- Steve

> if (!sem)
> return_ACPI_STATUS(AE_NO_MEMORY);
> - memset(sem, 0, sizeof(struct semaphore));
> + memset(sem, 0, sizeof(struct arch_semaphore));
>
> sema_init(sem, initial_units);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/