From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH] gpio: Convert gpio_is_valid to return bool Date: Wed, 11 May 2011 01:42:22 +0200 Message-ID: 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=ISO-8859-1 Return-path: Received: from mail-iy0-f174.google.com ([209.85.210.174]:37222 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753539Ab1EJXmW (ORCPT ); Tue, 10 May 2011 19:42:22 -0400 In-Reply-To: <1305069787.19586.141.camel@Joe-Laptop> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Joe Perches Cc: Arnd Bergmann , Grant Likely , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org 2011/5/11 Joe Perches : > 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 Acked-by: Linus Walleij Thanks Joe! Linus Walleij