53 lines
2.2 KiB
Diff
53 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
|
Date: Thu, 14 Jan 2021 19:26:03 +0100
|
|
Subject: [PATCH] ASoC: sun4i-i2s: Add parenthesis around macro arguments
|
|
|
|
Several macro arguments are not put inside parenthesis, which may cause
|
|
subtle issues.
|
|
|
|
Fix those macros.
|
|
|
|
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|
---
|
|
sound/soc/sunxi/sun4i-i2s.c | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
|
|
index 4b8ca5be0a29..fdefe8cc6365 100644
|
|
--- a/sound/soc/sunxi/sun4i-i2s.c
|
|
+++ b/sound/soc/sunxi/sun4i-i2s.c
|
|
@@ -116,16 +116,16 @@
|
|
|
|
#define SUN8I_I2S_CHAN_CFG_REG 0x30
|
|
#define SUN8I_I2S_CHAN_CFG_RX_SLOT_NUM_MASK GENMASK(6, 4)
|
|
-#define SUN8I_I2S_CHAN_CFG_RX_SLOT_NUM(chan) ((chan - 1) << 4)
|
|
+#define SUN8I_I2S_CHAN_CFG_RX_SLOT_NUM(chan) (((chan) - 1) << 4)
|
|
#define SUN8I_I2S_CHAN_CFG_TX_SLOT_NUM_MASK GENMASK(2, 0)
|
|
-#define SUN8I_I2S_CHAN_CFG_TX_SLOT_NUM(chan) (chan - 1)
|
|
+#define SUN8I_I2S_CHAN_CFG_TX_SLOT_NUM(chan) ((chan) - 1)
|
|
|
|
#define SUN8I_I2S_TX_CHAN_MAP_REG 0x44
|
|
#define SUN8I_I2S_TX_CHAN_SEL_REG 0x34
|
|
#define SUN8I_I2S_TX_CHAN_OFFSET_MASK GENMASK(13, 12)
|
|
-#define SUN8I_I2S_TX_CHAN_OFFSET(offset) (offset << 12)
|
|
+#define SUN8I_I2S_TX_CHAN_OFFSET(offset) ((offset) << 12)
|
|
#define SUN8I_I2S_TX_CHAN_EN_MASK GENMASK(11, 4)
|
|
-#define SUN8I_I2S_TX_CHAN_EN(num_chan) (((1 << num_chan) - 1) << 4)
|
|
+#define SUN8I_I2S_TX_CHAN_EN(num_chan) (((1 << (num_chan)) - 1) << 4)
|
|
|
|
#define SUN8I_I2S_RX_CHAN_SEL_REG 0x54
|
|
#define SUN8I_I2S_RX_CHAN_MAP_REG 0x58
|
|
@@ -134,9 +134,9 @@
|
|
#define SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET_MASK GENMASK(21, 20)
|
|
#define SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET(offset) ((offset) << 20)
|
|
#define SUN50I_H6_I2S_TX_CHAN_SEL_MASK GENMASK(19, 16)
|
|
-#define SUN50I_H6_I2S_TX_CHAN_SEL(chan) ((chan - 1) << 16)
|
|
+#define SUN50I_H6_I2S_TX_CHAN_SEL(chan) (((chan) - 1) << 16)
|
|
#define SUN50I_H6_I2S_TX_CHAN_EN_MASK GENMASK(15, 0)
|
|
-#define SUN50I_H6_I2S_TX_CHAN_EN(num_chan) (((1 << num_chan) - 1))
|
|
+#define SUN50I_H6_I2S_TX_CHAN_EN(num_chan) (((1 << (num_chan)) - 1))
|
|
|
|
#define SUN50I_H6_I2S_TX_CHAN_MAP0_REG 0x44
|
|
#define SUN50I_H6_I2S_TX_CHAN_MAP1_REG 0x48
|