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.

iio: adc: mcp3911: avoid ambiguity parameters in macros

Name macro parameters after what they represent instead of 'x'
and make sure the evaluation of that will have no side effects.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20230822192259.1125792-6-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Marcus Folkesson and committed by
Jonathan Cameron
593d7362 7e504733

+4 -4
+4 -4
drivers/iio/adc/mcp3911.c
··· 29 29 #define MCP3911_REG_MOD 0x06 30 30 #define MCP3911_REG_PHASE 0x07 31 31 #define MCP3911_REG_GAIN 0x09 32 - #define MCP3911_GAIN_MASK(ch) (GENMASK(2, 0) << 3 * ch) 33 - #define MCP3911_GAIN_VAL(ch, val) ((val << 3 * ch) & MCP3911_GAIN_MASK(ch)) 32 + #define MCP3911_GAIN_MASK(ch) (GENMASK(2, 0) << 3 * (ch)) 33 + #define MCP3911_GAIN_VAL(ch, val) ((val << 3 * (ch)) & MCP3911_GAIN_MASK(ch)) 34 34 35 35 #define MCP3911_REG_STATUSCOM 0x0a 36 36 #define MCP3911_STATUSCOM_DRHIZ BIT(12) ··· 51 51 #define MCP3911_REG_GAINCAL_CH1 0x17 52 52 #define MCP3911_REG_VREFCAL 0x1a 53 53 54 - #define MCP3911_CHANNEL(x) (MCP3911_REG_CHANNEL0 + x * 3) 55 - #define MCP3911_OFFCAL(x) (MCP3911_REG_OFFCAL_CH0 + x * 6) 54 + #define MCP3911_CHANNEL(ch) (MCP3911_REG_CHANNEL0 + (ch) * 3) 55 + #define MCP3911_OFFCAL(ch) (MCP3911_REG_OFFCAL_CH0 + (ch) * 6) 56 56 57 57 /* Internal voltage reference in mV */ 58 58 #define MCP3911_INT_VREF_MV 1200