Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: rockchip: i2s-tdm: switch to FIELD_PREP_WM16_CONST macro

The era of hand-rolled HIWORD_UPDATE macros is over, at least for those
drivers that use constant masks.

Replace the implementation of this driver's HIWORD_UPDATE macro with an
instance of FIELD_PREP_WM16_CONST. The const variant is chosen here
because some of the header defines are then used in initializers.

This gives us some compile-time error checking, while keeping the diff
very small and easy to review.

Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>

authored by

Nicolas Frattaroli and committed by
Yury Norov
3d1ef6e4 63df37f3

+3 -1
+3 -1
sound/soc/rockchip/rockchip_i2s_tdm.h
··· 10 10 #ifndef _ROCKCHIP_I2S_TDM_H 11 11 #define _ROCKCHIP_I2S_TDM_H 12 12 13 + #include <linux/hw_bitfield.h> 14 + 13 15 /* 14 16 * TXCR 15 17 * transmit operation control register ··· 287 285 #define I2S_TDM_RXCR (0x0034) 288 286 #define I2S_CLKDIV (0x0038) 289 287 290 - #define HIWORD_UPDATE(v, h, l) (((v) << (l)) | (GENMASK((h), (l)) << 16)) 288 + #define HIWORD_UPDATE(v, h, l) (FIELD_PREP_WM16_CONST(GENMASK((h), (l)), (v))) 291 289 292 290 /* PX30 GRF CONFIGS */ 293 291 #define PX30_I2S0_CLK_IN_SRC_FROM_TX HIWORD_UPDATE(1, 13, 12)