From patchwork Sun Aug 17 14:28:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 4731271 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 86CAAC0338 for ; Sun, 17 Aug 2014 14:29:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 986792012E for ; Sun, 17 Aug 2014 14:29:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D1B2720123 for ; Sun, 17 Aug 2014 14:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751282AbaHQO3A (ORCPT ); Sun, 17 Aug 2014 10:29:00 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:34470 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbaHQO27 (ORCPT ); Sun, 17 Aug 2014 10:28:59 -0400 Received: by mail-pd0-f176.google.com with SMTP id y10so5886618pdj.7 for ; Sun, 17 Aug 2014 07:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=d4hWYWfXvX+O+VChyeztD0wIRw4z3u+++w5+r+U1D/s=; b=Qw89gLBYZBobXn4Tkz0+jn97zf43axH1hsj0VFiflc7vyMziWfp+UhMLS4jZfZXysB ykvcB57+oAJ3YUWMyHc8SXO+S4GQXU6QsL9niEiVfWc5yd4AjtfV8/OnfD4aMBjVEg9v pxLAhF22xnFvwfgJ+e9J9A0mZzginNsp0OkslbUYULjCsuXzBgvcXBhTxc3RmqyfVMZR uSv8Yr1Wf6q6Ulh7U1uyB9aiLqOlwIPnCzhLzP0eFQiHCpiZLK0JDS6YJDDKTdvnomIq M1Frs7lKtxAu4nIyg+uDjzf1bFoh6aUysP67ZZNjy0yrk8aiTIfEkZmx2ucMn7WM+M2n 0dDQ== X-Received: by 10.68.250.3 with SMTP id yy3mr28156531pbc.56.1408285738832; Sun, 17 Aug 2014 07:28:58 -0700 (PDT) Received: from mailhub.coreip.homeip.net (c-50-136-245-103.hsd1.ca.comcast.net. [50.136.245.103]) by mx.google.com with ESMTPSA id am2sm13520289pbc.59.2014.08.17.07.28.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 Aug 2014 07:28:58 -0700 (PDT) Date: Sun, 17 Aug 2014 07:28:52 -0700 From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Nick Dyer , Stephen Warren , linux-kernel@vger.kernel.org Subject: [PATCH] Input: atmel_mxt_ts - remove unneeded check Message-ID: <20140817142851.GA21153@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 This fixes the following issue reported by Coverity: ** CID 1231785: Unsigned compared against 0 (NO_EFFECT) /drivers/input/touchscreen/atmel_mxt_ts.c: 1157 in mxt_prepare_cfg_mem() The variable 'byte_offset' is declared as unsigned int and therefore can never be less than 0. Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index db178ed..8780c9a 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1154,7 +1154,7 @@ static int mxt_prepare_cfg_mem(struct mxt_data *data, byte_offset = reg + i - cfg_start_ofs; - if (byte_offset >= 0 && byte_offset < config_mem_size) { + if (byte_offset < config_mem_size) { *(config_mem + byte_offset) = val; } else { dev_err(dev, "Bad object: reg:%d, T%d, ofs=%d\n",