From patchwork Mon Sep 21 13:34:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 7230841 Return-Path: X-Original-To: patchwork-linux-fbdev@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 9489D9F380 for ; Mon, 21 Sep 2015 13:48:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C40B720761 for ; Mon, 21 Sep 2015 13:48:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DAEF120764 for ; Mon, 21 Sep 2015 13:48:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932434AbbIUNsL (ORCPT ); Mon, 21 Sep 2015 09:48:11 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:37352 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932349AbbIUNgX (ORCPT ); Mon, 21 Sep 2015 09:36:23 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NV1005VS4GLSJ60@mailout2.w1.samsung.com>; Mon, 21 Sep 2015 14:36:21 +0100 (BST) X-AuditID: cbfec7f5-f794b6d000001495-64-560007d5bc0e Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id F8.67.05269.5D700065; Mon, 21 Sep 2015 14:36:21 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NV100LNT4DTKI10@eusync3.samsung.com>; Mon, 21 Sep 2015 14:36:21 +0100 (BST) From: Andrzej Hajda To: linux-kernel@vger.kernel.org Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Tomi Valkeinen , Jean-Christophe Plagniol-Villard , linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH 28/38] video/omap: remove invalid check Date: Mon, 21 Sep 2015 15:34:00 +0200 Message-id: <1442842450-29769-29-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1442842450-29769-1-git-send-email-a.hajda@samsung.com> References: <1442842450-29769-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t/xq7pX2RnCDG5cUbO4te4cq8XGGetZ LU70fWC1uLxrDpvF7CX9LBZrj9xlt1j38AWTxfr5t9gcODxeXbjD4tG3ZRWjx/Eb25k8Pm+S C2CJ4rJJSc3JLEst0rdL4Mr4eNCs4Btbxdu3i1kaGC+zdjFyckgImEh8b33ICGGLSVy4t54N xBYSWMooce5sThcjF5DdxCRxbMM+sASbgKbE3803wWwRAQWJzb3PWEGKmAXWM0msv/sXbKqw gLnE2j1fwIpYBFQlvm3bx97FyMHBK+AicWNvFsQyOYmTxyaDlXMChQ8c/MICsdhZ4sCSI0wT GHkXMDKsYhRNLU0uKE5KzzXSK07MLS7NS9dLzs/dxAgJqa87GJceszrEKMDBqMTD6yjwP1SI NbGsuDL3EKMEB7OSCK/OLKAQb0piZVVqUX58UWlOavEhRmkOFiVx3pm73ocICaQnlqRmp6YW pBbBZJk4OKUaGDXUDf3OPljV1uL/sF449Z66kb3ex8XtUVZ1H4XDGfzEToU8yr32eaWeieec uXoaDTwR7Z3vpK+9KeG/V7jcJf2nRZqy2Kf3khcackzOJdmw6zZzLsk6GJZfvlrf8VzcFO63 5cIvLcTfeE6ys2EqsVz1fn/Fx1XmSu/8pq1hLGZyjbyV9claiaU4I9FQi7moOBEAcB7u1CUC AAA= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 regno is unsigned so it cannot be negative. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/video/fbdev/omap/omapfb_main.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 1fb3ea3..393ae1b 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -276,11 +276,6 @@ static int _setcolreg(struct fb_info *info, u_int regno, u_int red, u_int green, if (r != 0) break; - if (regno < 0) { - r = -EINVAL; - break; - } - if (regno < 16) { u16 pal; pal = ((red >> (16 - var->red.length)) <<