linux/sound/soc/ux500
Sasha Levin 11fc0048a6
ASoC: ux500: Parenthesize MSP_{RX,TX}_CLKPOL_BIT() arguments
arm allmodconfig fails to build with gcc:

  In file included from sound/soc/ux500/ux500_msp_i2s.c:20:
  sound/soc/ux500/ux500_msp_i2s.h:151:38: error: suggest parentheses
  around arithmetic in operand of '^' [-Werror=parentheses]
  sound/soc/ux500/ux500_msp_i2s.c:204:21: note: in expansion of macro
  'MSP_TX_CLKPOL_BIT'
  cc1: all warnings being treated as errors

The macros never parenthesized their argument:

  #define MSP_TX_CLKPOL_BIT(n)  ((n & TCKPOL_MASK) << TCKPOL_SHIFT)

That went unnoticed while every caller passed a plain variable, but
configure_protocol() now passes an XOR expression, which binds as
"a ^ (b & MASK)" rather than "(a ^ b) & MASK", and gcc rightly
complains.

No functional change: tx_clk_pol and rx_clk_pol only ever hold
MSP_FALLING_EDGE (0) or MSP_RISING_EDGE (1), and bclk_inverted is a
bool, so masking before or after the XOR gives the same 0/1 result.
Parenthesize the argument anyway - it fixes the build and stops the
macros from silently mis-evaluating a future composite argument.

Fixes: 9ccbacf5a0 ("ASoC: ux500: Validate MSP DAI configuration")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609051547.G9SJp8UQ-lkp@intel.com/
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260913173132.1172003-1-sashal@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-09-16 20:04:26 +01:00
..
Kconfig ASoC: ux500: Standardize ASoC menu 2025-06-24 01:01:29 +01:00
Makefile ASoC: ux500: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:37 +09:00
mop500_ab8500.c ASoC: ux500: mop500_ab8500: tidyup mop500_ab8500_remove() 2026-07-30 00:22:22 +01:00
mop500_ab8500.h ASoC: ux500: Remove some leftover from the "Replace GPLv2 boilerplate/reference with SPDX" rules 2022-06-06 12:38:28 +01:00
mop500.c ASoC: ux500: mop500: tidyup mop500_of_probe() parameter 2026-07-30 00:22:21 +01:00
ux500_msp_dai.c ASoC: ux500: Allow repeated MSP prepare calls 2026-09-02 12:56:07 +01:00
ux500_msp_dai.h ASoC: ux500: Allow repeated MSP prepare calls 2026-09-02 12:56:07 +01:00
ux500_msp_i2s.c ASoC: ux500: Program the MSP FIFO watermarks 2026-09-02 12:56:08 +01:00
ux500_msp_i2s.h ASoC: ux500: Parenthesize MSP_{RX,TX}_CLKPOL_BIT() arguments 2026-09-16 20:04:26 +01:00
ux500_pcm.c ASoC: ux500: convert not to use asoc_xxx() 2023-09-25 14:16:31 +02:00
ux500_pcm.h ASoC: ux500: Remove some leftover from the "Replace GPLv2 boilerplate/reference with SPDX" rules 2022-06-06 12:38:28 +01:00