From patchwork Wed Mar 8 13:13:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eirin Nya X-Patchwork-Id: 66237 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp332453wrd; Wed, 8 Mar 2023 05:32:16 -0800 (PST) X-Google-Smtp-Source: AK7set9yHlkqaorh72p21HWnITCX9mIJJ24CjOfP7DZ52spJIF6aOkr0XBzU4T3t2TEP3KxEgJSY X-Received: by 2002:a05:6402:3cc:b0:4c1:aa3e:8a6d with SMTP id t12-20020a05640203cc00b004c1aa3e8a6dmr16448984edw.23.1678282336384; Wed, 08 Mar 2023 05:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678282336; cv=none; d=google.com; s=arc-20160816; b=Jf1eVsRYlJDDyNziJuah90JMlTJg6GUX3GVCxZGDQ4hV8voaS3SIyoiXfPstDAnpC6 +AXYFqiAxyGmtPC07vS5Sg3ojmaZ1p2gcUvoeP/PxbSYyrvqYfh7nHc2JY4KmBO9nHj5 cCxgFjAfQ6PheC+h750D5IW2PO/fWYyLxFSbRPNxO4z+hWZXGeQV/smKNWPcbCN5xDiM wtVTKD3BpnJ9KK1J/1hcrtWinLjXAK4cZqYDxw8oKUdCYY3L83ppqI01eCJqDTy3Ohfk IJSKt5zLDE3Agi0jEGBrNh6fOsyCfup/FuEMPdgmkQLyJLGwO+Pq5ny8f+9rbmwyXvkm gWaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Pfh0KN1ri+OTygQJZXMIKBpXa0FBqGE1v3ae9U34K4M=; b=PN/cUbfXSud4kByWFdY4Ux6Z4m5Xk/LfCOTDfwxLweGp6f1Ei5NFBYFoHDkfsOIut1 Yw1ll+ZGzAOSm3iZKtODj54xGsxYiobTIU4XFphppstbH8CEAaRxYR7Rw8Z0Lw1vHc4h ieqr9A6meYqusTMl+moJF35qohDzHlFdG+G4O/VTAgq13TyMI3tikXe8MvULkkvCwH+s bykDsk/upcuzlN0GdvQOZc91CuMHvs58xZ2hz0JDN3oj1kLBT1EvLk0R+ie8B+NOYAUS fWIWnHICDfhkY1SWg8X0ZpXvdv4kOBAILXLp5I+hXB2rpnFurDVItVhJIOK0vFvRvAyE GbJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QClyTe2I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e21-20020a170906505500b008e161646775si2707848ejk.180.2023.03.08.05.31.52; Wed, 08 Mar 2023 05:32:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QClyTe2I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229692AbjCHNRC (ORCPT + 99 others); Wed, 8 Mar 2023 08:17:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231259AbjCHNQe (ORCPT ); Wed, 8 Mar 2023 08:16:34 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D2DCA244; Wed, 8 Mar 2023 05:13:24 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id m8-20020a17090a4d8800b002377bced051so2284149pjh.0; Wed, 08 Mar 2023 05:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678281201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pfh0KN1ri+OTygQJZXMIKBpXa0FBqGE1v3ae9U34K4M=; b=QClyTe2I/hwZ33JYUtvcFvlYFCxqH6gGxddkb6Mw9ZaqpgFxBKcorhq8UJPzxRRUCi uTx2PAKgI7bZrF/lTreDTxx7yWj9FiMv/lcDOtBO4kTVWb/ldkZzPi74PN0iCcPzjL0u 6IfzT1yMB1KmotWpnR50Ed/zp68QUvjkRw8+Z8BwLKfNv1LrRvjObQb5B0Mbo4meFOK8 pcECmBt83D7aT32ermDtuFvqSky7Wq8yWGobn3Y0xiIaiPUEjNFzDHO0el2pOBUSYoSH Mv2TTNWc/3XsfxfV4UkiSb0e0ybIrlSQyVaF3kOWv1Hfuo0AKLaOHX+E5g3t/m8T/NGm OzkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678281201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pfh0KN1ri+OTygQJZXMIKBpXa0FBqGE1v3ae9U34K4M=; b=lllP3brH++MGDGz/q2ahQweQz/5mCOcwi1g6kST1mZ4h2PdyAahnpbZyZAFrjiKKQd EN1n7m4jc4vAU8KcIcM1lgwj5vmFs65QbgeUN6nPy06Y1mMRJMew0xNSYXHILqdOUQ+N /Mgf7Bm/WzaMxwTFcEz/LInZ3BBKPhHGrEzh1L2/MjixAmzKSNlzVvVIvjy3keWNMh1c 7ty2OXncaS/OEzDzHt54JxIKzURWI5oPtLyfuHgyPBrXSK+Hy6YQjxuiW7+Ou60JIpb1 kkj2On0cYZZFMdDPbwe7cEi/IrvWuXWOWA9LkYs+Aw1B4bX1A9Qgonda0tTE3fYH6e6U mGtw== X-Gm-Message-State: AO0yUKVtxHp8cBSRsIKZfE60t7bqyul7u5gRRMvRqOaOn8NFtJndETue S17cFb8vxBn45QC/Z0lLf7BfCIKroqY/TQ== X-Received: by 2002:a05:6a20:8e05:b0:cb:c2a8:2c48 with SMTP id y5-20020a056a208e0500b000cbc2a82c48mr22265955pzj.17.1678281201203; Wed, 08 Mar 2023 05:13:21 -0800 (PST) Received: from localhost.localdomain (c-71-202-83-242.hsd1.ca.comcast.net. [71.202.83.242]) by smtp.gmail.com with ESMTPSA id i15-20020aa78b4f000000b0061ddff8c53dsm931038pfd.151.2023.03.08.05.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 05:13:20 -0800 (PST) From: Eirin Nya To: dmitry.torokhov@gmail.com Cc: mkorpershoek@baylibre.com, phoenix@emc.com.tw, josh.chen@emc.com.tw, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Eirin Nya Subject: [PATCH V2 RESEND 2/3] Input: elantech - Remove redundant field elantech_data::width Date: Wed, 8 Mar 2023 05:13:06 -0800 Message-Id: <20230308131307.13832-3-nyanpasu256@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230308131307.13832-1-nyanpasu256@gmail.com> References: <20230308131307.13832-1-nyanpasu256@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759806579243869711?= X-GMAIL-MSGID: =?utf-8?q?1759806579243869711?= elantech_data::width is copied from elantech_device_info::width, and neither is mutated after initialization. So remove the redundant variable to prevent future bugs. Signed-off-by: Eirin Nya Reviewed-by: Mattijs Korpershoek --- drivers/input/mouse/elantech.c | 4 +--- drivers/input/mouse/elantech.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 79e31611fc6e..263779c0313b 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -691,7 +691,7 @@ static void process_packet_head_v4(struct psmouse *psmouse) input_report_abs(dev, ABS_MT_POSITION_X, etd->mt[id].x); input_report_abs(dev, ABS_MT_POSITION_Y, etd->mt[id].y); input_report_abs(dev, ABS_MT_PRESSURE, pres); - input_report_abs(dev, ABS_MT_TOUCH_MAJOR, traces * etd->width); + input_report_abs(dev, ABS_MT_TOUCH_MAJOR, traces * etd->info.width); /* report this for backwards compatibility */ input_report_abs(dev, ABS_TOOL_WIDTH, traces); @@ -1253,8 +1253,6 @@ static int elantech_set_input_params(struct psmouse *psmouse) input_abs_set_res(dev, ABS_MT_POSITION_Y, info->y_res); } - etd->width = width; - return 0; } diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h index 1ec004f72d13..fb093134ead7 100644 --- a/drivers/input/mouse/elantech.h +++ b/drivers/input/mouse/elantech.h @@ -180,7 +180,6 @@ struct elantech_data { unsigned char reg_25; unsigned char reg_26; unsigned int single_finger_reports; - unsigned int width; struct finger_pos mt[ETP_MAX_FINGERS]; unsigned char parity[256]; struct elantech_device_info info;