iio: adc: ad7173: codestyle cleanup
Subsystems (2)
cover iio: adc: ad7173: codestyle cleanup
From: Sanjay Chitroda <[email protected]>
Hi all,
This patch series clean up error, warning(s) and a check reported with checkpatch and no functional behavior changes are intended.
Testing:
- Compiled with W=1
- Build-tested on QEMU x86_64
Based on:
<linux-v7.0-rc5>
Feedback and reviews are very welcome.
Thanks,
Sanjay Chitroda
Sanjay Chitroda (3):
iio: adc: ad7173: cleanup codestyle error
iio: adc: ad7173: cleanup codestyle warning(s)
iio: adc: ad7173: cleanup codestyle check and spell correct
drivers/iio/adc/ad7173.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/3 iio: adc: ad7173: cleanup codestyle error
From: Sanjay Chitroda <[email protected]>
Reported by checkpatch:
FILE: drivers/iio/adc/ad7173.c
ERROR: open brace '{' function definitions go on the next line
--- drivers/iio/adc/ad7173.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/adc/ad7173.c +2 -1
@@ -1763,7 +1763,8 @@ static int ad7173_validate_openwire_ain_inputs(struct ad7173_state *st,static unsigned int ad7173_calc_openwire_thrsh_raw (struct ad7173_state *st,struct iio_chan_spec *chan,struct ad7173_channel *chan_st_priv, -unsigned int thrsh_mv) { +unsigned int thrsh_mv) +{unsigned int thrsh_raw; thrsh_raw =
Signature · 1 line
2.34.1
PATCH 2/3 iio: adc: ad7173: cleanup codestyle warning(s)
In reply to Sanjay ChitrodaFrom: Sanjay Chitroda <[email protected]>
Reported by checkpatch:
FILE: drivers/iio/adc/ad7173.c
WARNING: Statements should start on a tabstop
--- drivers/iio/adc/ad7173.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/iio/adc/ad7173.c +6 -6
@@ -666,12 +666,12 @@ static bool ad7173_is_setup_equal(const struct ad7173_channel_config *cfg1,*/ static_assert(sizeof_field(struct ad7173_channel_config, config_props) ==sizeof (struct { -bool bipolar; -bool input_buf; -u16 sinc3_odr_div; -u8 sinc5_odr_index; -u8 ref_sel; -enum ad7173_filter_type filter_type; +bool bipolar; +bool input_buf; +u16 sinc3_odr_div; +u8 sinc5_odr_index; +u8 ref_sel; +enum ad7173_filter_type filter_type; })); return cfg1->bipolar == cfg2->bipolar &&
Signature · 1 line
2.34.1
PATCH 3/3 iio: adc: ad7173: cleanup codestyle check and spell correct
In reply to Sanjay ChitrodaFrom: Sanjay Chitroda <[email protected]>
Reported by checkpatch:
FILE: drivers/iio/adc/ad7173.c
CHECK: Avoid CamelCase: <AD7173_TEMP_SENSIIVITY_uV_per_C>
--- drivers/iio/adc/ad7173.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/adc/ad7173.c +3 -3
@@ -137,7 +137,7 @@#define AD7173_SETUP_REF_SEL_EXT_REF2 0x1#define AD7173_SETUP_REF_SEL_EXT_REF 0x0#define AD7173_VOLTAGE_INT_REF_uV 2500000 -#define AD7173_TEMP_SENSIIVITY_uV_per_C 477 +#define AD7173_TEMP_SENSITIVITY_UV_PER_C 477#define AD7177_ODR_START_VALUE 0x07#define AD4111_SHUNT_RESISTOR_OHM 50#define AD4111_DIVIDER_RATIO 10
@@ -1275,7 +1275,7 @@ static int ad7173_read_raw(struct iio_dev *indio_dev,switch (chan->type) {case IIO_TEMP : temp = AD7173_VOLTAGE_INT_REF_uV *MILLI ; - temp /= AD7173_TEMP_SENSIIVITY_uV_per_C; + temp /=AD7173_TEMP_SENSITIVITY_UV_PER_C ; *val = temp; *val2 = chan->scan_type.realbits;return IIO_VAL_FRACTIONAL_LOG2 ;
@@ -1300,7 +1300,7 @@ static int ad7173_read_raw(struct iio_dev *indio_dev,case IIO_TEMP :/* 0 Kelvin -> raw sample */ temp = -ABSOLUTE_ZERO_MILLICELSIUS ; - temp *= AD7173_TEMP_SENSIIVITY_uV_per_C; + temp *=AD7173_TEMP_SENSITIVITY_UV_PER_C ; temp <<= chan->scan_type.realbits; temp = DIV_U64_ROUND_CLOSEST(temp, AD7173_VOLTAGE_INT_REF_uV *
Signature · 1 line
2.34.1
Re: [PATCH 3/3] iio: adc: ad7173: cleanup codestyle check and spell correct
Quoted 4 lines · Sanjay Chitroda
Reported by checkpatch:
FILE:drivers/iio/adc/ad7173.cCHECK: Avoid CamelCase: <
AD7173_TEMP_SENSIIVITY_uV_per_C>
Fix checkpatch, please, to make it understand the Système International d'unités.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 3/3] iio: adc: ad7173: cleanup codestyle check and spell correct
Quoted 9 lines · Andy Shevchenko
Quoted 4 lines · Sanjay Chitroda
Reported by checkpatch:
FILE:drivers/iio/adc/ad7173.cCHECK: Avoid CamelCase: <
AD7173_TEMP_SENSIIVITY_uV_per_C>Fix checkpatch, please, to make it understand the Système International d'unités.
Hi Andy,
Thank you for the valuable input.
KTODO: update checkpatch to understand system international d'units.
e.g. Standard unit list:
Prefixes: u, m, k, M, G
Units: V, A, Hz, Ohm, C, K, s, W, etc.
David Lechner
reviewerQuoted 6 lines · Sanjay Chitroda
From: Sanjay Chitroda <[email protected]>
Hi all,
This patch series clean up error, warning(s) and a check reported with checkpatch and no functional behavior changes are intended.
I'm pretty sure someone sent a series just like this already.
Patches 2 and 3 were rejected. Patch 1 is probably OK.
Quoted 8 lines · David Lechner
Quoted 2 lines · Sanjay Chitroda
This patch series clean up error, warning(s) and a check reported with checkpatch and no functional behavior changes are intended.
I'm pretty sure someone sent a series just like this already.
Patches 2 and 3 were rejected. Patch 1 is probably OK.
Seconded. NAK for patches 2 & 3 from me here.
Patch 1 is OK, though.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Quoted 5 lines · David Lechner
Quoted 2 lines · Sanjay Chitroda
This patch series clean up error, warning(s) and a check reported with checkpatch and no functional behavior changes are intended.
Quoted 7 lines
Quoted 3 lines
I'm pretty sure someone sent a series just like this already.
Patches 2 and 3 were rejected. Patch 1 is probably OK.
Seconded. NAK for patches 2 & 3 from me here.
Patch 1 is OK, though.
Thank you David and Andy for the input.
Yes, similar changes is already available in iio/testing.
I have dropped this series.