linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Nehal Shah <nehal-bakulchandra.shah@amd.com>,
	Sandeep Singh <sandeep.singh@amd.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Richard Neumann <mail@richard-neumann.de>,
	linux-input@vger.kernel.org
Subject: [PATCH 1/3] AMD_SFH: Removed unused activecontrolstatus member from the amd_mp2_dev struct
Date: Thu, 28 Jan 2021 13:12:17 +0100	[thread overview]
Message-ID: <20210128121219.6381-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20210128121219.6381-1-hdegoede@redhat.com>

This value is only used once inside amd_mp2_get_sensor_num(),
so there is no need to store this in the amd_mp2_dev struct,
amd_mp2_get_sensor_num() can simple use a local variable for this.

Fixes: 4f567b9f8141 ("SFH: PCIe driver to add support of AMD sensor fusion hub")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 6 ++++--
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index dbac16641662..f3cdb4ea33da 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -76,9 +76,11 @@ void amd_stop_all_sensors(struct amd_mp2_dev *privdata)
 int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id)
 {
 	int activestatus, num_of_sensors = 0;
+	u32 activecontrolstatus;
+
+	activecontrolstatus = readl(privdata->mmio + AMD_P2C_MSG3);
+	activestatus = activecontrolstatus >> 4;
 
-	privdata->activecontrolstatus = readl(privdata->mmio + AMD_P2C_MSG3);
-	activestatus = privdata->activecontrolstatus >> 4;
 	if (ACEL_EN  & activestatus)
 		sensor_id[num_of_sensors++] = accel_idx;
 
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h
index 8f8d19b2cfe5..489415f7c22c 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h
@@ -61,7 +61,6 @@ struct amd_mp2_dev {
 	struct pci_dev *pdev;
 	struct amdtp_cl_data *cl_data;
 	void __iomem *mmio;
-	u32 activecontrolstatus;
 };
 
 struct amd_mp2_sensor_info {
-- 
2.29.2


  reply	other threads:[~2021-01-28 12:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 12:12 [PATCH 0/3] AMD_SFH: Allow overriding sensor-mask by module-param or DMI-quirk Hans de Goede
2021-01-28 12:12 ` Hans de Goede [this message]
2021-01-28 12:12 ` [PATCH 2/3] AMD_SFH: Add sensor_mask module parameter Hans de Goede
2021-01-28 12:12 ` [PATCH 3/3] AMD_SFH: Add DMI quirk table for BIOS-es which don't set the activestatus bits Hans de Goede
2021-02-15  8:24   ` Shah, Nehal-bakulchandra
2021-02-15  9:02     ` Richard Neumann
2021-02-22 11:53     ` Hans de Goede
     [not found]       ` <09f1754a-9299-7b83-5e3f-001c2d6ca6f1@amd.com>
2021-02-24 19:30         ` Hans de Goede
2021-01-28 13:24 ` [PATCH 0/3] AMD_SFH: Allow overriding sensor-mask by module-param or DMI-quirk Richard Neumann
2021-03-08 15:33 ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210128121219.6381-2-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=mail@richard-neumann.de \
    --cc=nehal-bakulchandra.shah@amd.com \
    --cc=sandeep.singh@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).