From: Herve Codina <herve.codina@bootlin.com>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE
Date: Mon, 13 Jan 2025 10:50:03 +0100 [thread overview]
Message-ID: <20250113105003.3b910b00@bootlin.com> (raw)
In-Reply-To: <20250113001001.400669-2-thorsten.blum@linux.dev>
Hi Thorsten,
On Mon, 13 Jan 2025 01:10:01 +0100
Thorsten Blum <thorsten.blum@linux.dev> wrote:
> Use the ARRAY_SIZE() macro to calculate PEB2466_TLV_SIZE and improve the
> code's readability.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> sound/soc/codecs/peb2466.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/peb2466.c b/sound/soc/codecs/peb2466.c
> index bb9ca6354ae1..a989cfe058f0 100644
> --- a/sound/soc/codecs/peb2466.c
> +++ b/sound/soc/codecs/peb2466.c
> @@ -26,8 +26,7 @@ struct peb2466_lookup {
> unsigned int count;
> };
>
> -#define PEB2466_TLV_SIZE (sizeof((unsigned int []){TLV_DB_SCALE_ITEM(0, 0, 0)}) / \
> - sizeof(unsigned int))
> +#define PEB2466_TLV_SIZE ARRAY_SIZE(((unsigned int[]){TLV_DB_SCALE_ITEM(0, 0, 0)}))
>
> struct peb2466_lkup_ctrl {
> int reg;
Acked-by: Herve Codina <herve.codina@bootlin.com>
Best regards,
Hervé
next prev parent reply other threads:[~2025-01-13 9:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 0:10 [PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE Thorsten Blum
2025-01-13 9:50 ` Herve Codina [this message]
2025-01-13 18:22 ` Mark Brown
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=20250113105003.3b910b00@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=thorsten.blum@linux.dev \
--cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.