From patchwork Wed Dec 16 15:07:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 68381 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBI4ixob005715 for ; Fri, 18 Dec 2009 04:46:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762174AbZLPPGH (ORCPT ); Wed, 16 Dec 2009 10:06:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759906AbZLPPGF (ORCPT ); Wed, 16 Dec 2009 10:06:05 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:58886 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759290AbZLPPGB (ORCPT ); Wed, 16 Dec 2009 10:06:01 -0500 Received: by bwz27 with SMTP id 27so771441bwz.21 for ; Wed, 16 Dec 2009 07:05:59 -0800 (PST) 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:subject:content-type :content-transfer-encoding; bh=LlvK9ZUC0ypZjNmwcxLWNipUAmp8FmfKHxqKP0DPxGE=; b=HN00b0nYCaYETjDHj5e7XYHE4N5v1+3SklVgC1VfyiuebCnV9NhIpA+JDlc7rsz8St JtnZeIuYPgyoX45xhoxbEjwHqIwFkCV4FAZs8Uz0eqAhmMSxUwe8IujCsU5NrK3TDv4n 19Mzs6goleUgEXvIfI/r2R6RfodbAnYFLPOO8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=dCPqgEwNDFMyguYqLj1p7IsAsgkhbLtmtD7BtCoW+aSK+wBi+5Y8OaK+y1Mtgp8SId qCupeynHzCJMaX/X9HkueH4zxvbjT0DKI+hKnRFnZaPpbWqhwfDi/eLwLWSvI7dtQB8Z qQDGsvEzZFGhfZq3z4lJgEG5O2pnafq6lxWS8= Received: by 10.103.67.35 with SMTP id u35mr541743muk.6.1260975957987; Wed, 16 Dec 2009 07:05:57 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id j2sm3588103mue.5.2009.12.16.07.05.57 (version=SSLv3 cipher=RC4-MD5); Wed, 16 Dec 2009 07:05:57 -0800 (PST) Message-ID: <4B28F7C9.5040206@gmail.com> Date: Wed, 16 Dec 2009 16:07:53 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Thunderbird/3.0b4 MIME-Version: 1.0 To: Jean-Francois Moine , linux-media@vger.kernel.org, Andrew Morton , LKML Subject: [PATCH] gspca: Fix tests of unsigned Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index 4dbb882..f5d1f18 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c @@ -1536,7 +1536,7 @@ static void setsharpness_96(struct gspca_dev *gspca_dev) u8 val; val = sd->sharpness; - if (val < 0) { /* auto */ + if (val == -1) { /* auto */ val = sccb_reg_read(gspca_dev, 0x42); /* com17 */ sccb_reg_write(gspca_dev, 0xff, 0x00); sccb_reg_write(gspca_dev, 0x42, val | 0x40); diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index b1944a7..7ebabe7 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c @@ -2319,7 +2319,7 @@ static void do_autogain(struct gspca_dev *gspca_dev, u16 avg_lum) } } if (avg_lum > MAX_AVG_LUM) { - if (sd->gain - 1 >= 0) { + if (sd->gain >= 1) { sd->gain--; set_gain(gspca_dev); }