staging: iio: impedance-analyzer: fix CamelCase in ad5933
Subsystems (4)
PATCH 1/1 staging: iio: impedance-analyzer: fix CamelCase in ad5933
checkpatch flagged mixed-case suffixes in #define names: _mVpp and _Hz. Rename to _MV_PP and _HZ to follow kernel UPPER_SNAKE_CASE convention.
Signed-off-by Jad Keskes <[email protected]>
--- drivers/staging/iio/impedance-analyzer/ad5933.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/iio/impedance-analyzer/ad5933.c +8 -8
@@ -43,10 +43,10 @@#define AD5933_CTRL_POWER_DOWN (0xA << 4)#define AD5933_CTRL_STANDBY (0xB << 4) -#define AD5933_CTRL_RANGE_2000mVpp (0x0 << 1) -#define AD5933_CTRL_RANGE_200mVpp (0x1 << 1) -#define AD5933_CTRL_RANGE_400mVpp (0x2 << 1) -#define AD5933_CTRL_RANGE_1000mVpp (0x3 << 1) +#define AD5933_CTRL_RANGE_2000_MV_PP (0x0 << 1) +#define AD5933_CTRL_RANGE_200_MV_PP (0x1 << 1) +#define AD5933_CTRL_RANGE_400_MV_PP (0x2 << 1) +#define AD5933_CTRL_RANGE_1000_MV_PP (0x3 << 1)#define AD5933_CTRL_RANGE (x) ((x) << 1)#define AD5933_CTRL_PGA_GAIN_1 (0x1 << 0)
@@ -68,8 +68,8 @@#define AD5933_I2C_ADDR_POINTER 0xB0/* Device Specs */ -#define AD5933_INT_OSC_FREQ_Hz 16776000 -#define AD5933_MAX_OUTPUT_FREQ_Hz 100000 +#define AD5933_INT_OSC_FREQ_HZ 16776000 +#define AD5933_MAX_OUTPUT_FREQ_HZ 100000#define AD5933_MAX_RETRIES 100#define AD5933_OUT_RANGE 1
@@ -303,7 +303,7 @@ static ssize_t ad5933_store_frequency(struct device *dev,if (ret)return ret; -if (val > AD5933_MAX_OUTPUT_FREQ_Hz) +if (val >AD5933_MAX_OUTPUT_FREQ_HZ )return -EINVAL ;if (!iio_device_claim_direct (indio_dev))
@@ -699,7 +699,7 @@ static int ad5933_probe(struct i2c_client *client) st->mclk_hz = ext_clk_hz; st->ctrl_lb =AD5933_CTRL_EXT_SYSCLK ; }else { - st->mclk_hz = AD5933_INT_OSC_FREQ_Hz; + st->mclk_hz =AD5933_INT_OSC_FREQ_HZ ; st->ctrl_lb =AD5933_CTRL_INT_SYSCLK ; }
Signature · 1 line
2.54.0
Quoted 3 lines · Jad Keskes
checkpatch flagged mixed-case suffixes in #define names:
_mVppand_Hz. Rename to_MV_PPand_HZto follow kernelUPPER_SNAKE_CASEconvention.
These are scientific things. milli vs Mega etc. The capitalization makes it a million times different from each other. We have to be correct instead of following checkpatch.
regards,
dan carpenter