From: Thorsten Blum Date: Mon, 13 Jan 2025 00:10:01 +0000 (+0100) Subject: ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8eb27b5758e6fb6d1881413e3f1159c579ac48b3;p=users%2Fjedix%2Flinux-maple.git 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 --- 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;