From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 15.mo4.mail-out.ovh.net ([91.121.62.11] helo=mo4.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ub86U-0001dk-AK for barebox@lists.infradead.org; Sat, 11 May 2013 11:36:43 +0000 Received: from mail643.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo4.mail-out.ovh.net (Postfix) with SMTP id EF578104DFAA for ; Sat, 11 May 2013 13:36:15 +0200 (CEST) Date: Sat, 11 May 2013 13:31:55 +0200 From: Jean-Christophe PLAGNIOL-VILLARD Message-ID: <20130511113155.GE19265@game.jcrosoft.org> References: <1368194658-2961-1-git-send-email-shc_work@mail.ru> <20130510141240.GD19265@game.jcrosoft.org> <1368269656.44400096@f345.mail.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1368269656.44400096@f345.mail.ru> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH] GPIO: Add gpio_to_desc helper To: Alexander Shiyan Cc: barebox@lists.infradead.org On 14:54 Sat 11 May , Alexander Shiyan wrote: > > On 18:04 Fri 10 May , Alexander Shiyan wrote: > > > Patch adds gpio_to_desc helper for validate GPIO. > > > A bit optimization is performed (about -250 bytes on ARM). > > > > > > Signed-off-by: Alexander Shiyan > > > --- > > > drivers/gpio/gpiolib.c | 97 ++++++++++++++++++++++++++------------------------ > > > 1 file changed, 51 insertions(+), 46 deletions(-) > > > > > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > > > index 6398268..d7aa094 100644 > > > --- a/drivers/gpio/gpiolib.c > > > +++ b/drivers/gpio/gpiolib.c > > > @@ -32,20 +32,30 @@ static int gpio_ensure_requested(struct gpio_info *gi, int gpio) > > > return gpio_request(gpio, "gpio"); > > > } > > > > > > +static struct gpio_info *gpio_to_desc(unsigned gpio) > > > +{ > > > + if (!gpio_is_valid(gpio)) > > put the WARN too as we need to known a gpio_xxx is used on a non valid gpio > > Original bb code does not contain any warnings here. So if it really > necessary it can be added later. put it as we keep the code inline with the kernel a key point for sync > > --- _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox