Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753673Ab1EJXmY (ORCPT ); Tue, 10 May 2011 19:42:24 -0400 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 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=YdmvfIhfiYqUVma0DaRbGujSYXA3EIhl5K2d41rrvzOO8Tjo9k6cya9CNNOaecz6K7 L4Sozkm5XU3gw0Z8YFAr7bjtZorsMokp76s9CtIIYlKjbAhhSChNFRb7CFvd98jSwrRp 8kWbfdCZzIjywFh+E3DIZCiHLFY+qMuaCao8o= MIME-Version: 1.0 In-Reply-To: <1305069787.19586.141.camel@Joe-Laptop> 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> Date: Wed, 11 May 2011 01:42:22 +0200 X-Google-Sender-Auth: dU-P9jLKXvD5zaYk7HRtziyYlVE Message-ID: Subject: Re: [PATCH] gpio: Convert gpio_is_valid to return bool From: Linus Walleij To: Joe Perches Cc: Arnd Bergmann , Grant Likely , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 654 Lines: 21 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 -- 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/