From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932198AbVLSPDy (ORCPT ); Mon, 19 Dec 2005 10:03:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932199AbVLSPDy (ORCPT ); Mon, 19 Dec 2005 10:03:54 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:16581 "EHLO pentafluge.infradead.org") by vger.kernel.org with ESMTP id S932198AbVLSPDx (ORCPT ); Mon, 19 Dec 2005 10:03:53 -0500 Date: Mon, 19 Dec 2005 15:03:52 +0000 From: Christoph Hellwig To: Steven Rostedt Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Arjan van de Ven , Alan Cox , Christoph Hellwig , Andi Kleen , David Howells , Alexander Viro , Oleg Nesterov , Paul Jackson Subject: Re: [patch 15/15] Generic Mutex Subsystem, arch-semaphores.patch Message-ID: <20051219150352.GC9809@infradead.org> Mail-Followup-To: Christoph Hellwig , Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Arjan van de Ven , Alan Cox , Andi Kleen , David Howells , Alexander Viro , Oleg Nesterov , Paul Jackson References: <20051219014043.GK28038@elte.hu> <1135002846.13138.258.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1135002846.13138.258.camel@localhost.localdomain> User-Agent: Mutt/1.4.2.1i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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.