[PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE

From: Thorsten Blum
Date: Sun Jan 12 2025 - 19:13:53 EST


Use the ARRAY_SIZE() macro to calculate PEB2466_TLV_SIZE and improve the
code's readability.

Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
---
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