From patchwork Wed Apr 13 19:32:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 8825091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA9139F71A for ; Wed, 13 Apr 2016 19:35:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE35D20377 for ; Wed, 13 Apr 2016 19:35:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A66720373 for ; Wed, 13 Apr 2016 19:35:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aqQXs-0008DW-RL; Wed, 13 Apr 2016 19:33:48 +0000 Received: from [187.113.16.13] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1aqQXp-0008AN-Lq; Wed, 13 Apr 2016 19:33:45 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.86_2) (envelope-from ) id 1aqQWj-0007F2-Vz; Wed, 13 Apr 2016 16:32:37 -0300 From: Mauro Carvalho Chehab To: Subject: [PATCH] [media] exynos-gsc: remove an always false condition Date: Wed, 13 Apr 2016 16:32:36 -0300 Message-Id: <26a7ed9c18193dc7a3dfba33e3c711822f4bdd29.1460575950.git.mchehab@osg.samsung.com> X-Mailer: git-send-email 2.5.5 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, Mauro Carvalho Chehab , Kamil Debski , Mauro Carvalho Chehab , Kukjin Kim , Sylwester Nawrocki , Linux Media Mailing List , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As reported by smatch: drivers/media/platform/exynos-gsc/gsc-core.c:1073 gsc_probe() warn: impossible condition '(gsc->id < 0) => (0-65535 < 0)' drivers/media/platform/exynos-gsc/gsc-core.c: In function 'gsc_probe': drivers/media/platform/exynos-gsc/gsc-core.c:1073:51: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (gsc->id >= drv_data->num_entities || gsc->id < 0) { ^ gsc->id is an u16, so it can never be a negative number. So, remove the always false condition. Fixes: c1ac057173ba "[media] exynos-gsc: remove non-device-tree init code" Cc: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab Acked-by: Sylwester Nawrocki --- drivers/media/platform/exynos-gsc/gsc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 032a423fb892..c595723f5031 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1070,7 +1070,7 @@ static int gsc_probe(struct platform_device *pdev) return -ENOMEM; gsc->id = of_alias_get_id(pdev->dev.of_node, "gsc"); - if (gsc->id >= drv_data->num_entities || gsc->id < 0) { + if (gsc->id >= drv_data->num_entities) { dev_err(dev, "Invalid platform device id: %d\n", gsc->id); return -EINVAL; }