public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>,
	Andrew Morton <akpm@osdl.org>,
	Arjan van de Ven <arjanv@infradead.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Christoph Hellwig <hch@infradead.org>, Andi Kleen <ak@suse.de>,
	David Howells <dhowells@redhat.com>,
	Alexander Viro <viro@ftp.linux.org.uk>,
	Oleg Nesterov <oleg@tv-sign.ru>, Paul Jackson <pj@sgi.com>
Subject: Re: [patch 15/15] Generic Mutex Subsystem, arch-semaphores.patch
Date: Mon, 19 Dec 2005 15:03:52 +0000	[thread overview]
Message-ID: <20051219150352.GC9809@infradead.org> (raw)
In-Reply-To: <1135002846.13138.258.camel@localhost.localdomain>

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.


  reply	other threads:[~2005-12-19 15:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-19  1:40 [patch 15/15] Generic Mutex Subsystem, arch-semaphores.patch Ingo Molnar
2005-12-19 14:34 ` Steven Rostedt
2005-12-19 15:03   ` Christoph Hellwig [this message]
2005-12-19 14:36 ` Steven Rostedt
2005-12-19 15:01 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051219150352.GC9809@infradead.org \
    --to=hch@infradead.org \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjanv@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    --cc=pj@sgi.com \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@osdl.org \
    --cc=viro@ftp.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox