From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [PATCH] gpio: Convert gpio_is_valid to return bool Date: Thu, 26 May 2011 21:02:56 -0600 Message-ID: <20110527030256.GF5032@ponder.secretlab.ca> References: <1304363786-30376-1-git-send-email-linus.walleij@stericsson.com> <1304365077.7792.40.camel@Joe-Laptop> <1305067020.19586.130.camel@Joe-Laptop> <1305069787.19586.141.camel@Joe-Laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pz0-f46.google.com ([209.85.210.46]:46150 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753074Ab1E0DC7 (ORCPT ); Thu, 26 May 2011 23:02:59 -0400 Content-Disposition: inline In-Reply-To: <1305069787.19586.141.camel@Joe-Laptop> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Joe Perches Cc: Linus Walleij , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org On Tue, May 10, 2011 at 04:23:07PM -0700, Joe Perches wrote: > Make the code a bit more readable. > > Instead of casting an int to an unsigned then comparing to > MAX_NR_GPIOS, add a >= 0 test and let the compiler optimizer > do the conversion to unsigned. > > The generated code should be the same. > > Signed-off-by: Joe Perches Applied, thanks. g.