From patchwork Sat Oct 27 20:41:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 1656741 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 87D8DDFAC4 for ; Sat, 27 Oct 2012 20:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758206Ab2J0Un7 (ORCPT ); Sat, 27 Oct 2012 16:43:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35963 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938Ab2J0Unz (ORCPT ); Sat, 27 Oct 2012 16:43:55 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9RKhYQB020654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 27 Oct 2012 16:43:34 -0400 Received: from pedra (vpn1-4-98.gru2.redhat.com [10.97.4.98]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9RKg8Hv017383 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 27 Oct 2012 16:43:34 -0400 Received: from v4l by pedra with local (Exim 4.76) (envelope-from ) id 1TSDCI-0007bi-5a; Sat, 27 Oct 2012 18:41:34 -0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Huang Shijie , Kang Yong , Zhang Xiaobing Subject: [PATCH 53/68] [media] tlg2300: index is unsigned, so never below zero Date: Sat, 27 Oct 2012 18:41:11 -0200 Message-Id: <1351370486-29040-54-git-send-email-mchehab@redhat.com> In-Reply-To: <1351370486-29040-1-git-send-email-mchehab@redhat.com> References: <1351370486-29040-1-git-send-email-mchehab@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org drivers/media/usb/tlg2300/pd-video.c:891:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] drivers/media/usb/tlg2300/pd-video.c:926:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Cc: Huang Shijie Cc: Kang Yong Cc: Zhang Xiaobing Signed-off-by: Mauro Carvalho Chehab Acked-by: Huang Shijie --- drivers/media/usb/tlg2300/pd-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c index 1f448ac..3082bfa 100644 --- a/drivers/media/usb/tlg2300/pd-video.c +++ b/drivers/media/usb/tlg2300/pd-video.c @@ -888,7 +888,7 @@ static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *in) { struct front_face *front = fh; - if (in->index < 0 || in->index >= POSEIDON_INPUTS) + if (in->index >= POSEIDON_INPUTS) return -EINVAL; strcpy(in->name, pd_inputs[in->index].name); in->type = V4L2_INPUT_TYPE_TUNER; @@ -923,7 +923,7 @@ static int vidioc_s_input(struct file *file, void *fh, unsigned int i) struct poseidon *pd = front->pd; s32 ret, cmd_status; - if (i < 0 || i >= POSEIDON_INPUTS) + if (i >= POSEIDON_INPUTS) return -EINVAL; ret = send_set_req(pd, SGNL_SRC_SEL, pd_inputs[i].tlg_src, &cmd_status);