From patchwork Wed Oct 21 15:43:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 55134 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9LFXfv0027695 for ; Wed, 21 Oct 2009 15:33:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754013AbZJUPdg (ORCPT ); Wed, 21 Oct 2009 11:33:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753966AbZJUPdg (ORCPT ); Wed, 21 Oct 2009 11:33:36 -0400 Received: from mail-ew0-f207.google.com ([209.85.219.207]:36068 "EHLO mail-ew0-f207.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753953AbZJUPdf (ORCPT ); Wed, 21 Oct 2009 11:33:35 -0400 Received: by ewy3 with SMTP id 3so6170057ewy.17 for ; Wed, 21 Oct 2009 08:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=2Rz2S2bhwJN/kcxftqgaUJLLS8LnDIgETwUdMpzM/7Q=; b=dZoeHz3lSLlmdnkcy/OiVOYnL/Jw0j4ZA8U5b2TCeVye5TzjjYCWGj99aCi/pPv345 XJz3X2SR+j7gtLE0V3lf0Cr64t1o9s8/dgyMmYrECZs5eK5F0jyGDRRiNwteuCddPWnQ cQXFtqPePajiVoHhYiDB9uJ6+0myW0Wiw7+Ug= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=G2hcMmT647BczTzH4uOUmFC2fvKSuLfBfokGZcKcF4PvdV9XUHn+7KpdvbAPpafPk4 Sj6i8xDBUkt8EbUGAWYCTxKa+JOwH6m93WOFvQIfDh1+EbLn9rwWujJy1dy/QoMVnsII UdATB/kgUwmE8RCkE/GYJA+Grl6tyCWTHN4WE= Received: by 10.211.154.10 with SMTP id g10mr9113758ebo.49.1256139219354; Wed, 21 Oct 2009 08:33:39 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 5sm266338eyh.42.2009.10.21.08.33.37 (version=SSLv3 cipher=RC4-MD5); Wed, 21 Oct 2009 08:33:37 -0700 (PDT) Message-ID: <4ADF2C30.3030401@gmail.com> Date: Wed, 21 Oct 2009 17:43:44 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: "Aguirre Rodriguez, Sergio Alberto" CC: Imre Deak , "linux-fbdev-devel@lists.sourceforge.net" , "linux-omap@vger.kernel.org" , Andrew Morton Subject: Re: [PATCH] omapfb: Wrong test on unsigned? References: <4AD8BA2F.9090307@gmail.com> In-Reply-To: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index 0d0c8c8..4da94d0 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c @@ -285,12 +285,6 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green, case OMAPFB_COLOR_RGB444: if (r != 0) break; - - if (regno < 0) { - r = -EINVAL; - break; - } - if (regno < 16) { u16 pal; pal = ((red >> (16 - var->red.length)) << @@ -299,6 +293,8 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green, var->green.offset) | (blue >> (16 - var->blue.length)); ((u32 *)(info->pseudo_palette))[regno] = pal; + } else { + r = -EINVAL; } break; default: