ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE
Subsystems (3)
PATCH 1/1 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.
--- sound/soc/codecs/peb2466.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/peb2466.c +1 -2
@@ -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;
Signature · 1 line
2.47.1
Hi Thorsten,
Quoted 13 lines · On Mon, 13 Jan 2025 01:10:01 +0100 Thorsten Blum <[email protected]>…
Use the
ARRAY_SIZE()macro to calculatePEB2466_TLV_SIZEand improve the code's readability.Signed-off-by Thorsten Blum <[email protected]>--- sound/soc/codecs/peb2466.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)sound/soc/codecs/peb2466.c +0
-0
sound/soc/codecs/peb2466.c struct peb2466_lookup { · line 32
Quoted 9 lines
sound/soc/codecs/peb2466.c +1
-2@@ -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;
Best regards,
Hervé
Mark Brown
maintainerQuoted 4 lines · Thorsten Blum
Use the
ARRAY_SIZE()macro to calculatePEB2466_TLV_SIZEand improve the code's readability.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE
commit: 8eb27b5758e6fb6d1881413e3f1159c579ac48b3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark