Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762235AbXKNEha (ORCPT ); Tue, 13 Nov 2007 23:37:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757456AbXKNEgy (ORCPT ); Tue, 13 Nov 2007 23:36:54 -0500 Received: from smtp124.sbc.mail.sp1.yahoo.com ([69.147.64.97]:32131 "HELO smtp124.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756846AbXKNEgx (ORCPT ); Tue, 13 Nov 2007 23:36:53 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=Received:X-YMail-OSG:From:To:Subject:Date:User-Agent:Cc:References:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=z1xQ/fwdlYcom7MyPweecBfl+Hd+d/mgatsUbJvAQGeeM8oa1xs7DQ21p+Wx6799+9KXb3fyFbQoWBC6IXxoDCSlcULs5iQb21BNLjwphq6oAsa+Ta1mx0F2ITSWa6P1JoT7WFVFuEyE8rUQE1HRXzgIeGB6w4p/7PEC1LYtGzM= ; X-YMail-OSG: t.z5nbgVM1mz8J5EvEKD1dSmaVg2ombt7HjzVWeDGyvPWLhVhP8VE88pQPjaMOlAwZKXxZ7rUA-- From: David Brownell To: "eric miao" Subject: Re: [patch/rfc 1/4] GPIO implementation framework Date: Tue, 13 Nov 2007 20:36:13 -0800 User-Agent: KMail/1.9.6 Cc: "Linux Kernel list" , "Felipe Balbi" , "Bill Gatliff" , "Haavard Skinnemoen" , "Andrew Victor" , "Tony Lindgren" , "Jean Delvare" , "Kevin Hilman" , "Paul Mundt" , "Ben Dooks" References: <200710291809.29936.david-b@pacbell.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200711132036.14927.david-b@pacbell.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1699 Lines: 51 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. 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. > @@ -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? ... overall the main downside of these patches seems to be that it consumes more static memory. - 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/