From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: "Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"David E Box" <david.e.box@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@intel.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v5 15/20] platform/x86/intel/tpmi: Build the TPMI control words in one expression
Date: Tue, 13 Oct 2026 12:29:30 -0700 [thread overview]
Message-ID: <20261013192935.2243291-16-sathyanarayanan.kuppuswamy@linux.intel.com> (raw)
In-Reply-To: <20261013192935.2243291-1-sathyanarayanan.kuppuswamy@linux.intel.com>
Both mailbox words in tpmi_read_feature_status() are assembled as an
assignment followed by an or-assign of a second field, even though
neither value is used in between. Build each of them in a single
expression, so that a word and the fields it is made of read as one
thing.
The two comments on the command word described one value between them, so
fold them together as well.
No functional change intended.
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
drivers/platform/x86/intel/tpmi_common.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/x86/intel/tpmi_common.c b/drivers/platform/x86/intel/tpmi_common.c
index 5332d30aac6c..a91938024d09 100644
--- a/drivers/platform/x86/intel/tpmi_common.c
+++ b/drivers/platform/x86/intel/tpmi_common.c
@@ -279,11 +279,12 @@ static int tpmi_read_feature_status(struct intel_tpmi_info *tpmi_info, int featu
if (ret)
return ret;
- /* set command id to 0x10 for TPMI_GET_STATE */
- data = FIELD_PREP(TMPI_CONTROL_DATA_CMD, TPMI_CONTROL_GET_STATE_CMD);
-
- /* 32 bits for DATA offset and +8 for feature_id field */
- data |= FIELD_PREP(TPMI_CONTROL_DATA_VAL_FEATURE, feature_id);
+ /*
+ * Set command id to 0x10 for TPMI_GET_STATE, with the feature id 32
+ * bits into the DATA offset, +8 for the feature_id field.
+ */
+ data = FIELD_PREP(TMPI_CONTROL_DATA_CMD, TPMI_CONTROL_GET_STATE_CMD) |
+ FIELD_PREP(TPMI_CONTROL_DATA_VAL_FEATURE, feature_id);
/* Write at command offset for qword access */
writeq(data, tpmi_info->tpmi_control_mem + TPMI_COMMAND_OFFSET);
@@ -294,8 +295,8 @@ static int tpmi_read_feature_status(struct intel_tpmi_info *tpmi_info, int featu
return ret;
/* Set Run Busy and packet length of 2 dwords */
- control = TPMI_CONTROL_STATUS_RB;
- control |= FIELD_PREP(TPMI_CONTROL_STATUS_LEN, TPMI_CMD_PKT_LEN);
+ control = TPMI_CONTROL_STATUS_RB |
+ FIELD_PREP(TPMI_CONTROL_STATUS_LEN, TPMI_CMD_PKT_LEN);
/* Write at status offset for qword access */
writeq(control, tpmi_info->tpmi_control_mem + TPMI_CONTROL_STATUS_OFFSET);
--
2.43.0
next prev parent reply other threads:[~2026-10-13 19:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 19:29 [PATCH v5 00/20] Decouple PCI and auxbus details from Intel TPMI driver Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 01/20] platform/x86/intel/tpmi: Use static strings for the feature device names Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 02/20] platform/x86/intel/vsec: Pass a struct device to intel_vsec_set_mapping() Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 03/20] platform/x86/intel/tpmi: Remove unused vsec_dev from intel_tpmi_pm_feature Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 04/20] platform/x86/intel/tpmi: Get tpmi_info directly from the parent device Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 05/20] platform/x86/intel/tpmi: Keep the feature resources in intel_tpmi_info Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 06/20] platform/x86/intel/tpmi: Describe a TPMI instance by its two devices Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 07/20] platform/x86/intel/tpmi: Drop unused arg from tpmi_set_control_base() Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 08/20] platform/x86/intel/tpmi: Do not assume TPMI is enumerated from PCI Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 09/20] platform/x86/intel/tpmi: Split out enumeration independent init and exit Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 10/20] platform/x86/intel/tpmi: Split off the PCI VSEC enumeration Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 11/20] platform/x86/intel/tpmi: Include the headers tpmi_common.c relies on Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 12/20] platform/x86/intel/tpmi: Turn TPMI_GET_SINGLE_ENTRY_SIZE() into a function Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 13/20] platform/x86/intel/tpmi: Use guard() for tpmi_dev_lock in the status read Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 14/20] platform/x86/intel/tpmi: Use scope based cleanup in the memory dump Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` Kuppuswamy Sathyanarayanan [this message]
2026-10-13 19:29 ` [PATCH v5 16/20] platform/x86/intel/tpmi: Use DEFINE_SHOW_STORE_ATTRIBUTE() for mem_write Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 17/20] platform/x86/intel/tpmi: Use scnprintf() to build the debugfs names Kuppuswamy Sathyanarayanan
2026-10-13 19:52 ` Andy Shevchenko
2026-10-13 19:29 ` [PATCH v5 18/20] platform/x86/intel/tpmi: Use DEFINE_RES_MEM() for the feature resources Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 19/20] platform/x86/intel/tpmi: Declare the loop counters in their loops Kuppuswamy Sathyanarayanan
2026-10-13 19:29 ` [PATCH v5 20/20] platform/x86/intel/tpmi: Describe the device creation policy on the function Kuppuswamy Sathyanarayanan
2026-10-15 14:28 ` [PATCH v5 00/20] Decouple PCI and auxbus details from Intel TPMI driver Ilpo Järvinen
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=20261013192935.2243291-16-sathyanarayanan.kuppuswamy@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=andriy.shevchenko@intel.com \
--cc=david.e.box@linux.intel.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.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
all inboxes | Powered by JetHome®