From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Gang Subject: Re: [PATCH] ARM: OMAP2: add type cast from 'unsigned' to 'signed' Date: Thu, 22 Aug 2013 15:43:41 +0800 Message-ID: <5215C12D.5020807@asianux.com> References: <521479B4.8030604@asianux.com> <20130822071402.GQ7656@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from intranet.asianux.com ([58.214.24.6]:57495 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753642Ab3HVHol (ORCPT ); Thu, 22 Aug 2013 03:44:41 -0400 In-Reply-To: <20130822071402.GQ7656@atomide.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Tony Lindgren Cc: Kevin Hilman , Russell King - ARM Linux , linux-omap@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" On 08/22/2013 03:14 PM, Tony Lindgren wrote: > * Chen Gang [130821 01:34]: >> Need add type cast, or can not notice the failure. The related warning >> (allmodconfig, "EXTRA_CFLAGS=-W"): >> >> arch/arm/mach-omap2/gpmc.c:728:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] >> >> >> Signed-off-by: Chen Gang >> --- >> arch/arm/mach-omap2/gpmc.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c >> index f3fdd6a..62377b5 100644 >> --- a/arch/arm/mach-omap2/gpmc.c >> +++ b/arch/arm/mach-omap2/gpmc.c >> @@ -725,7 +725,7 @@ static int gpmc_setup_irq(void) >> return -EINVAL; >> >> gpmc_irq_start = irq_alloc_descs(-1, 0, GPMC_NR_IRQ, 0); >> - if (gpmc_irq_start < 0) { >> + if ((signed)gpmc_irq_start < 0) { >> pr_err("irq_alloc_descs failed\n"); >> return gpmc_irq_start; >> } > > Hmm shouldn't we just have int gpmc_irq_start instead > of unsigned gpmc_irq_start? > Oh, thanks, that sounds reasonable to me, I will send patch v2. > Regards, > > Tony > > Thanks. -- Chen Gang