From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "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>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 18/19] platform/x86/intel/tpmi: Declare the loop counters in their loops
Date: Fri, 25 Sep 2026 10:55:33 -0700 [thread overview]
Message-ID: <5ff2f36f-12c7-464e-a9f5-89e1819c66c9@linux.intel.com> (raw)
In-Reply-To: <arWTaYKQzTpRaR1D@ashevche-desk.local>
Hi,
On 9/24/2026 2:17 PM, Andy Shevchenko wrote:
> On Thu, Sep 24, 2026 at 11:23:40AM -0700, Kuppuswamy Sathyanarayanan wrote:
>> Declare the loop counters in the for statements that use them, so that
>> they are scoped to their loops.
>>
>> In tpmi_create_device() this also replaces the tmp cursor, which moved
>> in step with the counter, with res[i].
>>
>> No functional change intended.
>
> ...
>
>> - for (i = 0, tmp = res; i < pfs->pfs_header.num_entries; i++, tmp++) {
>> + for (int i = 0; i < pfs->pfs_header.num_entries; i++) {
>> u64 entry_size_bytes = pfs->pfs_header.entry_size * sizeof(u32);
>>
>> - tmp->start = pfs->vsec_offset + entry_size_bytes * i;
>> - tmp->end = tmp->start + entry_size_bytes - 1;
>> - tmp->flags = IORESOURCE_MEM;
>> + res[i].start = pfs->vsec_offset + entry_size_bytes * i;
>> + res[i].end = res[i].start + entry_size_bytes - 1;
>> + res[i].flags = IORESOURCE_MEM;
>
> This should really use DEFINE_RES_MEM() instead.
>
>> }
>
> ...
>
> The rest is fine. So, make a prerequisite patch and rebase this one on top.
Sure. will do it in v3.
>
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
next prev parent reply other threads:[~2026-09-25 17:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 18:23 [PATCH v2 00/19] Decouple PCI and auxbus details from Intel TPMI driver Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 01/19] platform/x86/intel/tpmi: Use static strings for the feature device names Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 02/19] platform/x86/intel/vsec: Pass a struct device to intel_vsec_set_mapping() Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 03/19] platform/x86/intel/tpmi: Remove unused vsec_dev from intel_tpmi_pm_feature Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 04/19] platform/x86/intel/tpmi: Get tpmi_info directly from the parent device Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 05/19] platform/x86/intel/tpmi: Keep the feature resources in intel_tpmi_info Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 06/19] platform/x86/intel/tpmi: Describe a TPMI instance by its two devices Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 07/19] platform/x86/intel/tpmi: Drop unused arg from tpmi_set_control_base() Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 08/19] platform/x86/intel/tpmi: Do not assume TPMI is enumerated from PCI Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 09/19] platform/x86/intel/tpmi: Split out enumeration independent init and exit Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 10/19] platform/x86/intel/tpmi: Split off the PCI VSEC enumeration Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 11/19] platform/x86/intel/tpmi: Include the headers tpmi_common.c relies on Kuppuswamy Sathyanarayanan
2026-09-24 21:10 ` Andy Shevchenko
2026-09-24 18:23 ` [PATCH v2 12/19] platform/x86/intel/tpmi: Turn TPMI_GET_SINGLE_ENTRY_SIZE() into a function Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 13/19] platform/x86/intel/tpmi: Use guard() for tpmi_dev_lock in the status read Kuppuswamy Sathyanarayanan
2026-09-24 21:15 ` Andy Shevchenko
2026-09-24 18:23 ` [PATCH v2 14/19] platform/x86/intel/tpmi: Use scope based cleanup in the memory dump Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 15/19] platform/x86/intel/tpmi: Build the TPMI control words in one expression Kuppuswamy Sathyanarayanan
2026-09-24 21:14 ` Andy Shevchenko
2026-09-24 18:23 ` [PATCH v2 16/19] platform/x86/intel/tpmi: Use DEFINE_SHOW_STORE_ATTRIBUTE() for mem_write Kuppuswamy Sathyanarayanan
2026-09-24 21:14 ` Andy Shevchenko
2026-09-24 18:23 ` [PATCH v2 17/19] platform/x86/intel/tpmi: Use scnprintf() to build the debugfs names Kuppuswamy Sathyanarayanan
2026-09-24 18:23 ` [PATCH v2 18/19] platform/x86/intel/tpmi: Declare the loop counters in their loops Kuppuswamy Sathyanarayanan
2026-09-24 21:17 ` Andy Shevchenko
2026-09-25 17:55 ` Kuppuswamy Sathyanarayanan [this message]
2026-09-24 18:23 ` [PATCH v2 19/19] platform/x86/intel/tpmi: Describe the device creation policy on the function Kuppuswamy Sathyanarayanan
2026-09-24 21:19 ` Andy Shevchenko
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=5ff2f36f-12c7-464e-a9f5-89e1819c66c9@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®