From patchwork Sun Oct 8 22:26:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christos Gkekas X-Patchwork-Id: 9992033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3FE5460231 for ; Sun, 8 Oct 2017 22:26:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F8792862A for ; Sun, 8 Oct 2017 22:26:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 214D52862C; Sun, 8 Oct 2017 22:26:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD06C2862A for ; Sun, 8 Oct 2017 22:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510AbdJHW05 (ORCPT ); Sun, 8 Oct 2017 18:26:57 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:37092 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbdJHW05 (ORCPT ); Sun, 8 Oct 2017 18:26:57 -0400 Received: by mail-wm0-f67.google.com with SMTP id r68so6182885wmr.4; Sun, 08 Oct 2017 15:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ag9q/9SNdk0ihdaP3EQBa4lhXN71DTpqjeKssf8bKdA=; b=RPAItyle6SaCsmGo3tVm0/3bUe1mrhDYS2zqbPeALk/NvvEd0Q2ELJO1a4T9rrYMc9 76UKibMfLaoJ4l+PQ/bLPy60vcvfeDVt8kPBWdnlHxTTXZ70nZGn8duyqGrKjMVjXSE9 ROgEhNgCLGRGLb3W3am6GMPUWuDevY4uP9dMzgTdXMXSHaeS+Q1bLS9O5uLJJO2Ol4MS wYJs1ubrb6GzoVOdfMk54lZdbIidgfOSq50EtW2bobelQNrzbhJSfa4DOCQasZn/ilbL Jdvykqjo/yDvTTYD0utzySbVsofdSs8jov/A7sTBjuvHa8yHX29wjWhltLg7791XNVmp LTkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ag9q/9SNdk0ihdaP3EQBa4lhXN71DTpqjeKssf8bKdA=; b=Ho3UQp9jeD6JAknp/A40ZAxj5ZXUX4I6iI0miETrr14u1/GhuM6gapEMYIAul9TjxP KIpzlGAHpI49CXS9IQLw9fcrHBPLnN4EEkAf7sQ5qSZFZkOcyjCwiq0iN2G7SEikDEX5 T6J/45zmQSbgj9JHsXVPJLabk2x4jP18ZTwOZi0rtBrO1TWrbs6Fn8IhmBLtWAlCHS6n kO4m3cHFSntdeyRPtdCeKUTpP4+D3PEqn6aBUw3tkWBy1Qx6pR0S61vdSfrpfXmK6zD5 GOT1UofkoI5qzYreApt6q0IAQOiXqIk40TZlCleq+QblQiVVhJgnIWtq3BAU+HOT2dCQ 2d7Q== X-Gm-Message-State: AMCzsaUTvhHD6mrH6mpopE7B6mBlJgxmEsQ1X2xJ2ePkJDR5/McC/Amp 4ZL9V/AyHfSkaVgsy0eMnxU= X-Google-Smtp-Source: AOwi7QAHJptzI7UEMqa6I3dqvbAfUyGzURgwmrBeHP11thu4SF8FsI5QSMFURgaa9QR2nXVkWUe5qw== X-Received: by 10.223.164.18 with SMTP id d18mr3137951wra.232.1507501615892; Sun, 08 Oct 2017 15:26:55 -0700 (PDT) Received: from inspiron ([2a02:c7d:5e0c:c300:61ec:ecf7:55fa:ca9a]) by smtp.gmail.com with ESMTPSA id e17sm16501814wmf.46.2017.10.08.15.26.54 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Oct 2017 15:26:54 -0700 (PDT) From: Christos Gkekas To: Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christos Gkekas Subject: [PATCH] Input: synaptics-rmi4: Clean up redundant check Date: Sun, 8 Oct 2017 23:26:51 +0100 Message-Id: <1507501611-16703-1-git-send-email-chris.gekas@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable size_presence_regĀ·is unsigned so checking whether it is less than zero is redundant. Signed-off-by: Christos Gkekas --- drivers/input/rmi4/rmi_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index 4f2bb59..68fcb30 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -601,7 +601,7 @@ int rmi_read_register_desc(struct rmi_device *d, u16 addr, return ret; ++addr; - if (size_presence_reg < 0 || size_presence_reg > 35) + if (size_presence_reg > 35) return -EIO; memset(buf, 0, sizeof(buf));