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 <[email protected]> Acked-by: Herve Codina <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7299cc0 commit 8eb27b5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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)