staging: iio: cdc: ad7152: Fix CamelCase checkpatch warning
Subsystems (4)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/3 staging: iio: cdc: ad7152: Fix CamelCase checkpatch warning
This patch fix the check detect by the checkpatch.pl
CHECK: Avoid CamelCase
Convert the names into normal naming pattern
--- drivers/staging/iio/cdc/ad7152.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/iio/cdc/ad7152.c +5 -5
@@ -48,10 +48,10 @@/* Setup Register Bit Designations (AD7152_REG_CHx_SETUP) */ #define AD7152_SETUP_CAPDIFF bit(5) -#define AD7152_SETUP_RANGE_2pF (0 << 6) -#define AD7152_SETUP_RANGE_0_5pF bit(6) -#define AD7152_SETUP_RANGE_1pF (2 << 6) -#define AD7152_SETUP_RANGE_4pF (3 << 6) +#define AD7152_SETUP_RANGE_2pf (0 << 6) +#define AD7152_SETUP_RANGE_0_5pf bit(6) +#define AD7152_SETUP_RANGE_1pf (2 << 6) +#define AD7152_SETUP_RANGE_4pf (3 << 6)#define AD7152_SETUP_RANGE (x) ((x) << 6)/* Config Register Bit Designations (AD7152_REG_CFG) */
@@ -298,7 +298,7 @@ static int ad7152_write_raw(struct iio_dev *indio_dev,if (val2 == ad7152_scale_table[i])break ; - chip->setup[chan->channel] &= ~AD7152_SETUP_RANGE_4pF; + chip->setup[chan->channel] &= ~AD7152_SETUP_RANGE_4pf; chip->setup[chan->channel] |=AD7152_SETUP_RANGE (i); ret = i2c_smbus_write_byte_data(chip->client,
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines
Don't assume that checkpatch is right.
Like all units that are named after a person (here Faraday) the unit should be capitals. Checkpatch assumes that it is camel case but is wrong.
J
Thank you for informing me next time I'll sure that kind of mistake not happen.
Quoted 51 lines · On Thu, Sep 29, 2016 at 4:44 PM, <[email protected]> wrote:
Quoted 4 lines · Anchal Jain
This patch fix the check detect by the checkpatch.pl
CHECK: Avoid CamelCase
Convert the names into normal naming patternDon't assume that checkpatch is right.
Like all units that are named after a person (here Faraday) the unit should be capitals. Checkpatch assumes that it is camel case but is wrong.
J
Quoted 35 lines
Signed-off-by Anchal Jain <[email protected]>--- drivers/staging/iio/cdc/ad7152.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/staging/iio/cdc/ad7152.c +5
-5@@ -48,10 +48,10 @@/* Setup Register Bit Designations (AD7152_REG_CHx_SETUP) */ #define AD7152_SETUP_CAPDIFF bit(5) -#define AD7152_SETUP_RANGE_2pF (0 << 6) -#define AD7152_SETUP_RANGE_0_5pF bit(6) -#define AD7152_SETUP_RANGE_1pF (2 << 6) -#define AD7152_SETUP_RANGE_4pF (3 << 6) +#define AD7152_SETUP_RANGE_2pf (0 << 6) +#define AD7152_SETUP_RANGE_0_5pf bit(6) +#define AD7152_SETUP_RANGE_1pf (2 << 6) +#define AD7152_SETUP_RANGE_4pf (3 << 6)#define AD7152_SETUP_RANGE (x) ((x) << 6)/* Config Register Bit Designations (AD7152_REG_CFG) */ @@ -298,7 +298,7 @@ static int ad7152_write_raw(struct iio_dev *indio_dev,if (val2 == ad7152_scale_table[i])break ; - chip->setup[chan->channel] &= ~AD7152_SETUP_RANGE_4pF; + chip->setup[chan->channel] &= ~AD7152_SETUP_RANGE_4pf; chip->setup[chan->channel] |=AD7152_SETUP_RANGE (i); ret = i2c_smbus_write_byte_data(chip->client,
PATCH 3/3 staging: iio: cdc: ad7152: CHECK:Please use a blank line
In reply to a message not in the archiveThis patch fixes the checkpatch.pl issue:
CHECK: Please use a blank line after function/struct/union/enum declarations
--- drivers/staging/iio/cdc/ad7152.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/staging/iio/cdc/ad7152.c +4 -0
@@ -134,6 +134,7 @@ static inline ssize_t ad7152_start_calib(struct device *dev,mutex_unlock (&indio_dev->mlock);return len; } + static ssize_t ad7152_start_offset_calib(struct device *dev, struct device_attribute *attr, const char *buf,
@@ -142,6 +143,7 @@ static ssize_t ad7152_start_offset_calib(struct device *dev,return ad7152_start_calib (dev, attr, buf, len,AD7152_CONF_MODE_OFFS_CAL ); } + static ssize_t ad7152_start_gain_calib(struct device *dev, struct device_attribute *attr, const char *buf,
@@ -317,6 +319,7 @@ out:mutex_unlock (&indio_dev->mlock);return ret; } + static int ad7152_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2,
@@ -470,6 +473,7 @@ static const struct iio_chan_spec ad7152_channels[] = { BIT(IIO_CHAN_INFO_SCALE), } }; +/* * device probe and remove */
Signature · 1 line
1.9.1
Re: [Outreachy kernel] [PATCH 3/3] staging: iio: cdc: ad7152: CHECK:Please use a blank line
Hi Anchal,
Commit message should be clearer than that, insisting on why the change is needed.
e.g.
staging: iio: cdc: ad7152: Add blank line after declarations to increase readability
Quoted 54 lines · Anchal Jain
This patch fixes the checkpatch.pl issue:
CHECK: Please use a blank line after function/struct/union/enum declarations
Signed-off-by Anchal Jain <[email protected]>--- drivers/staging/iio/cdc/ad7152.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/staging/iio/cdc/ad7152.c +4
-1@@ -134,6 +134,7 @@ static inline ssize_t ad7152_start_calib(struct device *dev,mutex_unlock (&indio_dev->mlock);return len; } + static ssize_t ad7152_start_offset_calib(struct device *dev, struct device_attribute *attr, const char *buf,@@ -142,6 +143,7 @@ static ssize_t ad7152_start_offset_calib(struct device *dev,return ad7152_start_calib (dev, attr, buf, len,AD7152_CONF_MODE_OFFS_CAL ); } + static ssize_t ad7152_start_gain_calib(struct device *dev, struct device_attribute *attr, const char *buf,@@ -317,6 +319,7 @@ out:mutex_unlock (&indio_dev->mlock);return ret; } + static int ad7152_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2,@@ -470,6 +473,7 @@ static const struct iio_chan_spec ad7152_channels[] = { BIT(IIO_CHAN_INFO_SCALE), } }; +/* * device probe and remove */ --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/b7e14439773be72f471528ac4606413d19db383d.1475141738.git.anchalj109%40gmail.com.
For more options, visit https://groups.google.com/d/optout.