From patchwork Sun Oct 8 18:44:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christos Gkekas X-Patchwork-Id: 9991957 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 614F460231 for ; Sun, 8 Oct 2017 18:44:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B3AF1FF12 for ; Sun, 8 Oct 2017 18:44:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C670201CB; Sun, 8 Oct 2017 18:44:27 +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 CB29D1FF12 for ; Sun, 8 Oct 2017 18:44:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbdJHSoZ (ORCPT ); Sun, 8 Oct 2017 14:44:25 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:47489 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298AbdJHSoY (ORCPT ); Sun, 8 Oct 2017 14:44:24 -0400 Received: by mail-wm0-f66.google.com with SMTP id t69so17413107wmt.2; Sun, 08 Oct 2017 11:44:23 -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; bh=3PYZRJLp0jw/97zKEqr5F6lr3n2b1WbpFxqpC+jwP5E=; b=funny8q6jGjLoKlRKGsTxg0ZYV59DZFapBiGH5qTfqH0L/qTy0GT4/wN18yswttuVX JuXqnO6TAHIXU2WWDuJRz0H3uuKFEc1bn8ZWobsK8a5mO1c99uMi+g+W/+5VHcoNwXN3 f9kFEY4w+dedvLYJcIUSp4371luJ2HtHE+STNE/Hr3Upf0h+QXzuTSQH/zxBY3M0TPrD PY/4JSrX2o2UWvuWcBeVO8BacaZwd7BsBR47uuF+MxU3MWzqU5otVoNU552LNE3kLS8N Jq4+K3FtCnDO/6512y/wlbmg7fwqgXL40CfESfqn9M4kVahs/xuCv1oraScEg3ImPbm6 NCFw== 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; bh=3PYZRJLp0jw/97zKEqr5F6lr3n2b1WbpFxqpC+jwP5E=; b=pispVN2A+uSAD5b1TUjUicOZqhyOUHlQh4hENutWAlGVcxgDkqOR3bO5DMiQnFrgC3 JxJ2+jvGxJd67KI3nOzMHmIVCtOctvpzim3h1CXZzJFi2A6/Woq0AU4RQn/S/f6n4M8Y PtqIkG5GrIh0OzstkQAmG2BzYYfwC3jWIpOq096Pf11MVTDWF5XdWefh6JATDV7woAKw WOWPHBHcxPa0bx8FbR2u6V4tAO6s805oURWLPPOO69f+gaKhA+YXySJo6jPs8S0hY1Db y1A38JrFMJnSXiWVGEDSOB/0wINymnvJy/S+7uPDw5cvpR6RTQXC62yhhnMiZABN6Lxl rcDg== X-Gm-Message-State: AMCzsaU6Of2G4JZMJ7j7v0HitI4uJha2ayKhS+VcJhRPsIJANRax6yeQ STk1ebTUiq9/b57Ot1DIhg4= X-Google-Smtp-Source: AOwi7QC/sJg4strLNV+6403vDHYrXYKVDO8/zu1bs2dRzuzSQPKBjLnJx8IyEYBG/gJ2lprLugCi2w== X-Received: by 10.28.22.66 with SMTP id 63mr6213584wmw.11.1507488263348; Sun, 08 Oct 2017 11:44:23 -0700 (PDT) Received: from inspiron ([2a02:c7d:5e0c:c300:61ec:ecf7:55fa:ca9a]) by smtp.gmail.com with ESMTPSA id q188sm4942003wmb.43.2017.10.08.11.44.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Oct 2017 11:44:22 -0700 (PDT) From: Christos Gkekas To: Nick Dyer , Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christos Gkekas Subject: [PATCH] Input: atmel_mxt_ts - Remove unnecessary byte_offset check Date: Sun, 8 Oct 2017 19:44:18 +0100 Message-Id: <1507488258-22409-1-git-send-email-chris.gekas@gmail.com> X-Mailer: git-send-email 2.7.4 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 byte_offset is unsigned so checking whether it is greater or equal to zero is redundant. Signed-off-by: Christos Gkekas Signed-off-by: Nick Dyer --- 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 7659bc4..baafaed 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1356,7 +1356,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",