From patchwork Wed Apr 7 09:41:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 3135 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Wed, 07 Apr 2010 09:41:23 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Wed, 07 Apr 2010 07:15:30 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NzRlD-0002ob-JH; Wed, 07 Apr 2010 09:41:23 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932253Ab0DGJlW (ORCPT + 1 other); Wed, 7 Apr 2010 05:41:22 -0400 Received: from fg-out-1718.google.com ([72.14.220.158]:50915 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790Ab0DGJlU (ORCPT ); Wed, 7 Apr 2010 05:41:20 -0400 Received: by fg-out-1718.google.com with SMTP id d23so364458fga.1 for ; Wed, 07 Apr 2010 02:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=2yn21mbto1437gq0a5fOrJWklq7kPhlLRSUAdZ9pmgE=; b=X0BDv3mwnJXyac3d/mzAWwlF7tbRqo9ro2MqdKzlf98FohHHho1P9gvjZinQiMGWum eNTxOc2hPEvkqY8eqbCE2wik7RGIN7ioDuwvytaKKIIh2yQ1u53esIol8MojVI6a5vC3 AquKOOgxc/4VXXHgAciIVVBn3k4HmA+SZ2apM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=KrU5XmHWgEbL2u6EbvCMImMtlWZqy/OHdGdX4885NjNzBYzIFPnuOwmEEK46m+zGTS PcCCmqy3QTMjgd8kD1qUr4xSD/YeFVKBteWo3Eyum57oXwqLJH8NSWDy3TqF1gPqMnqm 1IvKxYYu4KIsNIX3WbIrwbW4X9RZrroMH7OhI= Received: by 10.103.67.38 with SMTP id u38mr4722903muk.107.1270633278766; Wed, 07 Apr 2010 02:41:18 -0700 (PDT) Received: from bicker ([196.43.68.50]) by mx.google.com with ESMTPS id i7sm5391931mue.34.2010.04.07.02.41.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Apr 2010 02:41:18 -0700 (PDT) Date: Wed, 7 Apr 2010 12:41:14 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Guennadi Liakhovetski , Kuninori Morimoto , Magnus Damm , Hans Verkuil , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] video: comparing unsigned with negative 0 Message-ID: <20100407094114.GH5157@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org soc_mbus_bytes_per_line() returns -EINVAL on error but we store it in an unsigned int so the test for less than zero doesn't work. I think it always returns "small" positive values so we can just cast it to int here. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 6e16b39..1ad980f 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -1633,7 +1633,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd, height = pix->height; pix->bytesperline = soc_mbus_bytes_per_line(width, xlate->host_fmt); - if (pix->bytesperline < 0) + if ((int)pix->bytesperline < 0) return pix->bytesperline; pix->sizeimage = height * pix->bytesperline;