From patchwork Mon Jun 22 15:30:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 31752 X-Patchwork-Delegate: dougsland@redhat.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 n5MDURmc031289 for ; Mon, 22 Jun 2009 13:30:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbZFVNaV (ORCPT ); Mon, 22 Jun 2009 09:30:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751607AbZFVNaV (ORCPT ); Mon, 22 Jun 2009 09:30:21 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:39688 "EHLO mail-ew0-f210.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751514AbZFVNaU (ORCPT ); Mon, 22 Jun 2009 09:30:20 -0400 Received: by ewy6 with SMTP id 6so4698891ewy.37 for ; Mon, 22 Jun 2009 06:30:21 -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:content-type :content-transfer-encoding; bh=yZRMeOWWQrDJIemvbxKYm7QBnJLuTPsWF7MFU9Q+/zk=; b=LCIiLETigzseIOaR7SI4XmeS1kWPRE3Ie+nJ8ZM1ezo1hog6+XHsybi+rUOX/rxPs0 HPe+KyaOLgIgBj9TlsDgRenBv0DMTPONCoEcz7hL3lFjaVR84wbVG9vq8+47wyBBUQRV nTx3nQxYUFU0zW9rCdZ2Bi2b/XlXQbvX9UTmg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=Lg4XEdAbw466F/uVYBA5+cDZcOxxy5Q8NWA0Ezcec/FAbDbSw/XzZlWdq5NYqeMtPT b5jkU7lLcK6QwwIaKmCstR6scn82hZiDQsUIKayVUxmllegR4xg8o2O7d8YKDYK3DW6j 5DTXNB/Ljwdwg9K0P6Vo1Fiwk1r/dBNxKakfE= Received: by 10.216.25.144 with SMTP id z16mr2189547wez.179.1245677421540; Mon, 22 Jun 2009 06:30:21 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 10sm122156eyd.47.2009.06.22.06.30.20 (version=SSLv3 cipher=RC4-MD5); Mon, 22 Jun 2009 06:30:20 -0700 (PDT) Message-ID: <4A3FA3AC.1010703@gmail.com> Date: Mon, 22 Jun 2009 17:30:52 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: hverkuil@xs4all.nl, mchehab@infradead.org CC: linux-media@vger.kernel.org, Andrew Morton Subject: [PATCH] media: remove redundant tests on unsigned Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org input, inp and i are unsigned. When negative they are wrapped and caught by the other test. Signed-off-by: Roel Kluin --- -- 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/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c index ce64c62..8986d96 100644 --- a/drivers/media/dvb/ttpci/av7110_v4l.c +++ b/drivers/media/dvb/ttpci/av7110_v4l.c @@ -490,7 +490,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int input) if (!av7110->analog_tuner_flags) return 0; - if (input < 0 || input >= 4) + if (input >= 4) return -EINVAL; av7110->current_input = input; diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c index d7b1921..fc76e4d 100644 --- a/drivers/media/video/cx18/cx18-ioctl.c +++ b/drivers/media/video/cx18/cx18-ioctl.c @@ -605,7 +605,7 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp) if (ret) return ret; - if (inp < 0 || inp >= cx->nof_inputs) + if (inp >= cx->nof_inputs) return -EINVAL; if (inp == cx->active_input) { diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index e305c16..103096b 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c @@ -1797,7 +1797,7 @@ static int saa7134_s_input(struct file *file, void *priv, unsigned int i) if (0 != err) return err; - if (i < 0 || i >= SAA7134_INPUT_MAX) + if (i >= SAA7134_INPUT_MAX) return -EINVAL; if (NULL == card_in(dev, i).name) return -EINVAL;