Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764316AbXKNGvc (ORCPT ); Wed, 14 Nov 2007 01:51:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759014AbXKNGvY (ORCPT ); Wed, 14 Nov 2007 01:51:24 -0500 Received: from ro-out-1112.google.com ([72.14.202.177]:39895 "EHLO ro-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758431AbXKNGvX (ORCPT ); Wed, 14 Nov 2007 01:51:23 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oZ6Q8PAwuAVndVt6ec9PzWkQYp5mXZQNSkulsk5QnsKjl1oCK9uC1s4DyaZQeQJFF68gso9aOPT28GPIVIfJicbcY6GnSavzaYRDfVHsqr1OfeaZN9qXa6roCTn2yV41TgCjVYo0ZiCTGVvZOpD08/kd1d3oNF0cvQpL5xZdYWI= Message-ID: Date: Wed, 14 Nov 2007 14:51:22 +0800 From: "eric miao" To: "David Brownell" Subject: Re: [patch/rfc 1/4] GPIO implementation framework Cc: "Linux Kernel list" , "Felipe Balbi" , "Bill Gatliff" , "Haavard Skinnemoen" , "Andrew Victor" , "Tony Lindgren" , "Jean Delvare" , "Kevin Hilman" , "Paul Mundt" , "Ben Dooks" In-Reply-To: <200711132036.14927.david-b@pacbell.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200710291809.29936.david-b@pacbell.net> <200711132036.14927.david-b@pacbell.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2176 Lines: 70 On Nov 14, 2007 12:36 PM, David Brownell wrote: > On Tuesday 13 November 2007, eric miao wrote: > > Subject: [PATCH 5/5] move per GPIO "requested" to "struct gpio_desc" > > > > > struct gpio_desc { > > struct gpio_chip *chip; > > unsigned is_out:1; > > + unsigned requested:1; > > +#ifdef CONFIG_DEBUG_FS > > + const char *requested_str; > > +#endif > > A better name for this would be "label", matching what's > passed from gpio_request(). Ndls abrviatns r bd. > Fine. > > Note that this means (on typical 32-bit embedded hardware) > twelve bytes per GPIO, which if you assume 256 GPIOs means > an extra 3 KB static memory compared to the patch I sent. > Note this reduces the memory in gpio_chip, so it consumes almost same memory as the patch you sent. > > > @@ -43,20 +43,19 @@ static inline int gpio_is_onchip(unsigned gpio, > > struct gpio_chip *chip) > > /* Warn when drivers omit gpio_request() calls -- legal but > > * ill-advised when setting direction, and otherwise illegal. > > */ > > -static void gpio_ensure_requested(struct gpio_chip *chip, unsigned offset) > > +static void gpio_ensure_requested(unsigned gpio) > > Simpler to pass a gpio_desc pointer ... > > > > if (!requested) > > - printk(KERN_DEBUG "GPIO-%d autorequested\n", > > - chip->base + offset); > > + pr_debug("GPIO-%d autorequested\n", gpio); > > Leave the printk in ... this is the sort of thing we want > to see fixed, which becomes unlikely once you hide such > diagnostics. And for that matter, what would be enabling > the "-DDEBUG" that would trigger a pr_debug() message? > line length issue, just ignore this if you prefer. > > > ... overall the main downside of these patches seems to > be that it consumes more static memory. > Not really, since it reduces the holes. That all depend on your ARCH_NR_GPIOS. -- Cheers - eric - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/