From 8eb27b5758e6fb6d1881413e3f1159c579ac48b3 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Mon, 13 Jan 2025 01:10:01 +0100 Subject: [PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE Use the ARRAY_SIZE() macro to calculate PEB2466_TLV_SIZE and improve the code's readability. Signed-off-by: Thorsten Blum Acked-by: Herve Codina Link: https://patch.msgid.link/20250113001001.400669-2-thorsten.blum@linux.dev Signed-off-by: Mark Brown --- 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 bb9ca6354ae1b..a989cfe058f02 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.39.5