Skip to content

Commit 8eb27b5

Browse files
tobluxbroonie
authored andcommitted
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 <thorsten.blum@linux.dev> Acked-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20250113001001.400669-2-thorsten.blum@linux.dev Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7299cc0 commit 8eb27b5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

sound/soc/codecs/peb2466.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ struct peb2466_lookup {
2626
unsigned int count;
2727
};
2828

29-
#define PEB2466_TLV_SIZE (sizeof((unsigned int []){TLV_DB_SCALE_ITEM(0, 0, 0)}) / \
30-
sizeof(unsigned int))
29+
#define PEB2466_TLV_SIZE ARRAY_SIZE(((unsigned int[]){TLV_DB_SCALE_ITEM(0, 0, 0)}))
3130

3231
struct peb2466_lkup_ctrl {
3332
int reg;

0 commit comments

Comments
 (0)