On Mon, Dec 19, 2005 at 09:34:06AM -0500, Steven Rostedt wrote:
> > 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.
What's more important is that acpi is doing something fundamentally stupid
here. Putting a lock into a separate allocation (and the allocator wrapped
again..) is just freaking stupid, period.
Someone needs to go through ACPI and rewrite this freaking junk into proper
linux code. Maybe it'd even get less buggy if a single person finally had
a chance to actually understand all of the code after only half of it is
left ;-)
>
> -- 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);
and a memset to it, WTF.. seems like the acpi people just need to be shot.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]