* [PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE
@ 2025-01-13 0:10 Thorsten Blum
2025-01-13 9:50 ` Herve Codina
2025-01-13 18:22 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2025-01-13 0:10 UTC (permalink / raw)
To: Herve Codina, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai
Cc: Thorsten Blum, linux-sound, linux-kernel
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;
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE
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
2025-01-13 18:22 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Herve Codina @ 2025-01-13 9:50 UTC (permalink / raw)
To: Thorsten Blum
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
linux-sound, linux-kernel
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é
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE
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
@ 2025-01-13 18:22 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-01-13 18:22 UTC (permalink / raw)
To: Herve Codina, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Thorsten Blum
Cc: linux-sound, linux-kernel
On Mon, 13 Jan 2025 01:10:01 +0100, Thorsten Blum wrote:
> Use the ARRAY_SIZE() macro to calculate PEB2466_TLV_SIZE and improve the
> code's readability.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE
commit: 8eb27b5758e6fb6d1881413e3f1159c579ac48b3
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-13 18:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-01-13 18:22 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox