[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250113105003.3b910b00@bootlin.com>
Date: Mon, 13 Jan 2025 10:50:03 +0100
From: Herve Codina <herve.codina@...tlin.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate
PEB2466_TLV_SIZE
Hi Thorsten,
On Mon, 13 Jan 2025 01:10:01 +0100
Thorsten Blum <thorsten.blum@...ux.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@...ux.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@...tlin.com>
Best regards,
Hervé
Powered by blists - more mailing lists