From patchwork Sat Aug 22 21:43:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrik De Bie X-Patchwork-Id: 7056391 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DCEF6C05AC for ; Sat, 22 Aug 2015 21:44:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91736206C3 for ; Sat, 22 Aug 2015 21:44:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67158206BC for ; Sat, 22 Aug 2015 21:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751302AbbHVVoj (ORCPT ); Sat, 22 Aug 2015 17:44:39 -0400 Received: from e2big.org ([198.61.226.133]:51082 "EHLO e2big.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbbHVVoj (ORCPT ); Sat, 22 Aug 2015 17:44:39 -0400 Received: from d8d860a47.access.telenet.be ([141.134.10.71] helo=lantern.debie) by e2big.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1ZTGab-0006qa-7i; Sat, 22 Aug 2015 23:44:37 +0200 From: Ulrik De Bie To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, Hans de Goede , ulrik.debie-os@e2big.org, Duson Lin Subject: [PATCH v1 1/1] Input: elantech - Remove the ETP_SAMPLE_QUERY read that is now redundant Date: Sat, 22 Aug 2015 23:43:40 +0200 Message-Id: <1440279820-30996-1-git-send-email-ulrik.debie-os@e2big.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <4478D504-18DD-463D-9CC3-2697A215B9B7@emc.com.tw> References: <4478D504-18DD-463D-9CC3-2697A215B9B7@emc.com.tw> 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.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 commit 6b30c73e9f37183ad60c7f7050acf8e8edf91e9c introduced a read of ETP_SAMPLE_QUERY to etd->samples on line 1662. Because of that introduction, this other read of ETP_SAMPLE_QUERY at line 1040 becomes redundant and the already read etd->samples can be used instead. This line 1040 read will only be called when (etd->fw_version >> 16) == 0x14 and consequentially hardware version != 1 so the line 1662 read is also called. Signed-off-by: Ulrik De Bie CC: Duson Lin --- drivers/input/mouse/elantech.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 2955f1d..825be4b 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -1037,11 +1037,10 @@ static int elantech_set_range(struct psmouse *psmouse, fixed_dpi = param[1] & 0x10; if (((etd->fw_version >> 16) == 0x14) && fixed_dpi) { - if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, param)) - return -1; - - *x_max = (etd->capabilities[1] - i) * param[1] / 2; - *y_max = (etd->capabilities[2] - i) * param[2] / 2; + *x_max = (etd->capabilities[1] - i) * + etd->samples[1] / 2; + *y_max = (etd->capabilities[2] - i) * + etd->samples[2] / 2; } else if (etd->fw_version == 0x040216) { *x_max = 819; *y_max = 405;