From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <rafael@kernel.org>, <linux-acpi@vger.kernel.org>,
<robert.moore@intel.com>, <pierre-louis.bossart@linux.intel.com>,
<amadeuszx.slawinski@linux.intel.com>
Subject: Re: [PATCH 3/4] ACPI: NHLT: Table manipulation helpers
Date: Mon, 17 Jul 2023 10:08:50 +0200 [thread overview]
Message-ID: <e248bcbf-06b0-a312-2f35-5e8c148cd218@intel.com> (raw)
In-Reply-To: <ZK7Ig6TPhnnKs3Yi@smile.fi.intel.com>
On 2023-07-12 5:36 PM, Andy Shevchenko wrote:
> On Wed, Jul 12, 2023 at 11:10:47AM +0200, Cezary Rojewski wrote:
>> The table is composed of a range of endpoints with each describing
>> audio formats they support. Thus most of the operations involve
>> iterating over elements of the table. Simplify the process by
>> implementing range of getters.
>
> A few nit-picks below.
> In general, LGTM,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> (Please, use my @linux.intel.com address for LKML and related)
...
>> +/*
>> + * The for_each_nhlt_xxx() macros rely on an iterator to deal with the
>
> I would do s/xxx/*/
Ack.
>> + * variable length of each endpoint structure and the possible presence
>> + * of an OED-Config used by Windows only.
>> + */
>> +
>> +/**
>> + * for_each_nhlt_endpoint - Iterate over endpoints in a NHLT table.
>> + * @tb: the pointer to a NHLT table.
>> + * @ep: the pointer to endpoint to use as loop cursor.
>> + */
>> +#define for_each_nhlt_endpoint(tb, ep) \
>> + for (unsigned int __i = 0; \
>> + __i < (tb)->endpoint_count && \
>> + ((ep) = __acpi_nhlt_get_endpoint(tb, ep, __i)); \
>
> Do you really need ep to be in parentheses?
Agree. Also, checked how include/linux/list.h looks like and it aligns
with your proposal.
>> + __i++)
>> +
>> +/**
>> + * for_each_nhlt_fmtcfg - Iterate over format configurations.
>> + * @fmts: the pointer to formats configuration space.
>> + * @fmt: the pointer to format to use as loop cursor.
>> + */
>> +#define for_each_nhlt_fmtcfg(fmts, fmt) \
>> + for (unsigned int __i = 0; \
>> + __i < (fmts)->formats_count && \
>> + ((fmt) = __acpi_nhlt_get_fmtcfg(fmts, fmt, __i)); \
>
> Similar for fmt.
Ditto.
>> + __i++)
next prev parent reply other threads:[~2023-07-17 8:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 9:10 [PATCH 0/4] ACPI: NHLT: Access and query helpers Cezary Rojewski
2023-07-12 9:10 ` [PATCH 1/4] ACPI: NHLT: Device configuration access interface Cezary Rojewski
2023-07-12 9:10 ` [PATCH 2/4] ACPI: NHLT: Introduce acpi_gbl_NHLT Cezary Rojewski
2023-07-12 9:10 ` [PATCH 3/4] ACPI: NHLT: Table manipulation helpers Cezary Rojewski
2023-07-12 15:36 ` Andy Shevchenko
2023-07-17 8:08 ` Cezary Rojewski [this message]
2023-07-12 9:10 ` [PATCH 4/4] ACPI: NHLT: Add query functions Cezary Rojewski
2023-07-12 15:48 ` Andy Shevchenko
2023-07-17 8:29 ` Cezary Rojewski
2023-07-17 9:47 ` Andy Shevchenko
2023-07-17 11:25 ` Cezary Rojewski
2023-07-18 11:11 ` Cezary Rojewski
2023-07-18 14:17 ` 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=e248bcbf-06b0-a312-2f35-5e8c148cd218@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rafael@kernel.org \
--cc=robert.moore@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