Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1004250rwb; Fri, 7 Oct 2022 07:02:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VTFvNmNBMyNYOFLqwyRr8GoVq/6KMyXFNEjPQcsSFf9sRTiBP9PrTveMl/um6ufoIs5C5 X-Received: by 2002:a17:902:cecf:b0:178:3fa3:1583 with SMTP id d15-20020a170902cecf00b001783fa31583mr5299599plg.141.1665151359467; Fri, 07 Oct 2022 07:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665151359; cv=none; d=google.com; s=arc-20160816; b=pUsXcfdkMibSs0CutjKr16HWlu36ozGUrkJbNz+FHImT56YFS6pX5dFYiMxU6uQsJY m8WK3XD2uX8d4BGBLbUhL9p5e88e2KZrqkiTcnHUSg6Caj4KqCuS1cMZw5oVwKHu4mdr iJSVfnwXO08VdB8Y7ZhfmDDpLvIAfvar9q/pTIt3yxy+RWyuK+I3JJJp4fiFOC7b3+X4 5MpMxFFFvEEKbldwHzM8DXqwmK3lqemadxbdYGfMg9do8bF3ceYAGj6l1hMhzzSSCrYA 81lpj/r2Ir2axCR9NnaskpX2y1NreTj45O2b53bYHzH30j4s+FLrFp+yPc9D/tcoBoQZ Inqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=JplDCaPdcpXfop1zb7dVxKPrP4e+os7PmJQXzlx7wCo=; b=bLDqb8WtC8yrIfFPey7YBrfmxoQa3jpO7H0osECHkiAqCXCX5LTfiE8iDAZyNwF52+ NF9f8pygRejKW8477t2N++z+SDkUAyH4nnSULKxQeScYce14fRDfevT7efEvG6eu4v6z MX0qVF9MGeGHBRLhMRxYSoxDgaxlfsFDUYtTk04cEv9/G8QZ3rHJ3xOiuK8A6sYFD8Wh 5YYmgwAiixPiL6e1ZZNwbB8T3wXCWuxNYp7IUeXeKtfLWZ2XABAVyshQ41iJx7WzqBUV vNkpZgqSEvvXqMvIVj8reK6rxKIq3m4P8OjIAaLffZDI/891M1NHr8ia12c2VtOI0zn1 ciMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=flc9tV3i; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo12-20020a056a000e8c00b0052e11b066bcsi1896332pfb.166.2022.10.07.07.02.25; Fri, 07 Oct 2022 07:02:39 -0700 (PDT) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=flc9tV3i; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbiJGNfl (ORCPT + 99 others); Fri, 7 Oct 2022 09:35:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiJGNfi (ORCPT ); Fri, 7 Oct 2022 09:35:38 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BAEC9D51B for ; Fri, 7 Oct 2022 06:35:34 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id b4so7369366wrs.1 for ; Fri, 07 Oct 2022 06:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=JplDCaPdcpXfop1zb7dVxKPrP4e+os7PmJQXzlx7wCo=; b=flc9tV3iMOC8TfetLbTT2j8mQyS5wRTjK0EwEH9vjMD+FD35yMTwlZ5IXeBe77kbA+ NFpgip93XtId5kSzqsgNaf7YnS9/GfZAIRbs4grhqDxUfv3bEcxtbtIMLCACXDqNLFA1 KxaOJlj2U3Ma9F7FXZfRuSqSOTdYjofIBLNoA/FeP9aZ3izTzbZDTbHRAB7exR/2lxev LMswoGrSTD/quyClc4sUW7x7JGcHuZE1DcIXbOlkkMsSNjs5B2/e14kO4l3wfIhMTZSn VVFDHA0IoVqmQSyBJdv4aaU/lHeojgyyuRHlGBUUzsEAcyO95YB0W/OlBVt2aUg9F74J sjzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JplDCaPdcpXfop1zb7dVxKPrP4e+os7PmJQXzlx7wCo=; b=17dOSj1OQuqikLxqtf0bOHdxCVE6gE+ruXZKyuZwtpbLa4FW4JufNCXNa7zjrFEL7O 8T7waInzvyylI2M9vfwJE2xoEy5YF5lj/FudVjy1+w/iLxbECv+DGfN8jKryqljWjEam FhG8W5xOFcq3MV/mBPXdJOzyiKw4gvj0NMXfp/PclLlzcYoRcBjUV0Nh25wETE9AgNkf HfZiRtE+r+c+RMfY/LwmxJGvoURxZF9FQomcpsN+MAH1wrWeq9gXKaLvngWGrdFZCHb2 AgMsl0xY2zWSN6TvNHjRZQDPyve3M1MiAe48/PlE5yV/+Fj7p3KLHPW/askjCsyV2MNH t9Lw== X-Gm-Message-State: ACrzQf2TSdMz7cySc0vbXAtGqXBp2SFHewjE3YvAYKcEnbCax0gYbahd fr4aE83DD/GaUiFPgy6cjTCMyy6sHn2oxA== X-Received: by 2002:a5d:5a05:0:b0:22e:5b81:c295 with SMTP id bq5-20020a5d5a05000000b0022e5b81c295mr3273956wrb.588.1665149733086; Fri, 07 Oct 2022 06:35:33 -0700 (PDT) Received: from localhost ([2a01:cb19:85e6:1900:5f1e:d910:dd1e:5b09]) by smtp.gmail.com with ESMTPSA id fc19-20020a05600c525300b003a342933727sm8375178wmb.3.2022.10.07.06.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 06:35:32 -0700 (PDT) From: Mattijs Korpershoek To: Eirin Nya , linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] Input: Remove redundant field elantech_data::width In-Reply-To: <20220929082119.22112-3-nyanpasu256@gmail.com> References: <20220929082119.22112-1-nyanpasu256@gmail.com> <20220929082119.22112-3-nyanpasu256@gmail.com> Date: Fri, 07 Oct 2022 15:35:31 +0200 Message-ID: <87fsfz7o4c.fsf@mkorpershoek-xps-13-9370.home> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Thu, Sep 29, 2022 at 01:21, Eirin Nya wrote: > 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 ps: please consider using the proper subject line for input subsystem if you need to send again. It should be "Input: elantech - Remove redundant field elantech_data::width" $ git log --oneline drivers/input/mouse/elantech.c shows: 1d72d9f960cc Input: elantech - fix stack out of bound access in elantech_change_report_id() be896bd3b72b Input: elantench - fix misreporting trackpoint coordinates 9d383e96448d Input: elantech - Prepare a complete software node for the device (this is a minor remark, so no need to send a v2 to just change the subject line) Cheers Mattijs > --- > 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 79e31611fc..263779c031 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 1ec004f72d..fb093134ea 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; > -- > 2.37.3