linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] coding style warnings fixes
       [not found] <1494215850-26005-1-git-send-email-harinath922@gmail.com>
@ 2017-05-09  1:49 ` Harinath Nampally
  2017-05-09  1:49   ` [PATCH 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
                     ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Harinath Nampally @ 2017-05-09  1:49 UTC (permalink / raw)
  To: jsindhu81191; +Cc: harinath922, linux-kernel

This patchset is for fixes reported by checkpatch.pl

Please find the following patches:
[PATCH 1/3] staging: iio: meter: Add the comment for mutex definition
[PATCH 2/3] staging: iio: meter: Fix the identations for proper
[PATCH 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions
-------------------------------------------------------------------------
Harinath Nampally (3):
  staging: iio: meter: Add the comment for mutex definition in ade7753.c
  staging: iio: meter: Fix the identations for proper alignments in
    ade7753.c
  staging: iio: meter: Replace symbolic permissions with octal
    permissions in ade7753.c

 drivers/staging/iio/meter/ade7753.c | 104 ++++++++++++++++++------------------
 1 file changed, 52 insertions(+), 52 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/3] staging: iio: meter: Add the comment for mutex definition
  2017-05-09  1:49 ` [PATCH 0/3] coding style warnings fixes Harinath Nampally
@ 2017-05-09  1:49   ` Harinath Nampally
  2017-05-09  7:46     ` Dan Carpenter
  2017-05-09  1:49   ` [PATCH 2/3] staging: iio: meter: Fix the identations for proper alignments Harinath Nampally
  2017-05-09  1:49   ` [PATCH 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions Harinath Nampally
  2 siblings, 1 reply; 14+ messages in thread
From: Harinath Nampally @ 2017-05-09  1:49 UTC (permalink / raw)
  To: jsindhu81191; +Cc: harinath922, linux-kernel

This patch fixes below checkpatch.pl warning:
CHECK: struct mutex definition without comment

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---
 drivers/staging/iio/meter/ade7753.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
index b71fbd3..cffe6bf 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -78,12 +78,13 @@
 /**
  * struct ade7753_state - device instance specific data
  * @us:         actual spi_device
+ * @buf_lock:       mutex to protect tx and rx
  * @tx:         transmit buffer
  * @rx:         receive buffer
- * @buf_lock:       mutex to protect tx and rx
  **/
 struct ade7753_state {
 	struct spi_device   *us;
+ /* mutex to protect tx and rx */
 	struct mutex        buf_lock;
 	u8          tx[ADE7753_MAX_TX] ____cacheline_aligned;
 	u8          rx[ADE7753_MAX_RX];
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] staging: iio: meter: Fix the identations for proper alignments
  2017-05-09  1:49 ` [PATCH 0/3] coding style warnings fixes Harinath Nampally
  2017-05-09  1:49   ` [PATCH 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
@ 2017-05-09  1:49   ` Harinath Nampally
  2017-05-09  1:49   ` [PATCH 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions Harinath Nampally
  2 siblings, 0 replies; 14+ messages in thread
From: Harinath Nampally @ 2017-05-09  1:49 UTC (permalink / raw)
  To: jsindhu81191; +Cc: harinath922, linux-kernel

This patch fixes below checkpatch.pl kind of warnings:
CHECK: Alignment should match open parenthesis

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---
 drivers/staging/iio/meter/ade7753.c | 55 ++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
index cffe6bf..5d45a68 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -108,9 +108,8 @@ static int ade7753_spi_write_reg_8(struct device *dev,
 	return ret;
 }
 
-static int ade7753_spi_write_reg_16(struct device *dev,
-		u8 reg_address,
-		u16 value)
+static int ade7753_spi_write_reg_16(struct device *dev, u8 reg_address,
+				    u16 value)
 {
 	int ret;
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
@@ -127,8 +126,8 @@ static int ade7753_spi_write_reg_16(struct device *dev,
 }
 
 static int ade7753_spi_read_reg_8(struct device *dev,
-		u8 reg_address,
-		u8 *val)
+				  u8 reg_address,
+				  u8 *val)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct ade7753_state *st = iio_priv(indio_dev);
@@ -137,7 +136,7 @@ static int ade7753_spi_read_reg_8(struct device *dev,
 	ret = spi_w8r8(st->us, ADE7753_READ_REG(reg_address));
 	if (ret < 0) {
 		dev_err(&st->us->dev, "problem when reading 8 bit register 0x%02X",
-				reg_address);
+			reg_address);
 		return ret;
 	}
 	*val = ret;
@@ -146,8 +145,8 @@ static int ade7753_spi_read_reg_8(struct device *dev,
 }
 
 static int ade7753_spi_read_reg_16(struct device *dev,
-		u8 reg_address,
-		u16 *val)
+				   u8 reg_address,
+				   u16 *val)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct ade7753_state *st = iio_priv(indio_dev);
@@ -166,8 +165,8 @@ static int ade7753_spi_read_reg_16(struct device *dev,
 }
 
 static int ade7753_spi_read_reg_24(struct device *dev,
-		u8 reg_address,
-		u32 *val)
+				   u8 reg_address,
+				   u32 *val)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct ade7753_state *st = iio_priv(indio_dev);
@@ -190,7 +189,7 @@ static int ade7753_spi_read_reg_24(struct device *dev,
 	ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
 	if (ret) {
 		dev_err(&st->us->dev, "problem when reading 24 bit register 0x%02X",
-				reg_address);
+			reg_address);
 		goto error_ret;
 	}
 	*val = (st->rx[0] << 16) | (st->rx[1] << 8) | st->rx[2];
@@ -201,8 +200,8 @@ static int ade7753_spi_read_reg_24(struct device *dev,
 }
 
 static ssize_t ade7753_read_8bit(struct device *dev,
-		struct device_attribute *attr,
-		char *buf)
+				 struct device_attribute *attr,
+				 char *buf)
 {
 	int ret;
 	u8 val;
@@ -216,8 +215,8 @@ static ssize_t ade7753_read_8bit(struct device *dev,
 }
 
 static ssize_t ade7753_read_16bit(struct device *dev,
-		struct device_attribute *attr,
-		char *buf)
+				  struct device_attribute *attr,
+				  char *buf)
 {
 	int ret;
 	u16 val;
@@ -231,8 +230,8 @@ static ssize_t ade7753_read_16bit(struct device *dev,
 }
 
 static ssize_t ade7753_read_24bit(struct device *dev,
-		struct device_attribute *attr,
-		char *buf)
+				  struct device_attribute *attr,
+				  char *buf)
 {
 	int ret;
 	u32 val;
@@ -246,9 +245,9 @@ static ssize_t ade7753_read_24bit(struct device *dev,
 }
 
 static ssize_t ade7753_write_8bit(struct device *dev,
-		struct device_attribute *attr,
-		const char *buf,
-		size_t len)
+				  struct device_attribute *attr,
+				  const char *buf,
+				  size_t len)
 {
 	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
 	int ret;
@@ -264,9 +263,9 @@ static ssize_t ade7753_write_8bit(struct device *dev,
 }
 
 static ssize_t ade7753_write_16bit(struct device *dev,
-		struct device_attribute *attr,
-		const char *buf,
-		size_t len)
+				   struct device_attribute *attr,
+				   const char *buf,
+				   size_t len)
 {
 	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
 	int ret;
@@ -451,8 +450,8 @@ static int ade7753_initial_setup(struct iio_dev *indio_dev)
 }
 
 static ssize_t ade7753_read_frequency(struct device *dev,
-		struct device_attribute *attr,
-		char *buf)
+				      struct device_attribute *attr,
+				      char *buf)
 {
 	int ret;
 	u16 t;
@@ -469,9 +468,9 @@ static ssize_t ade7753_read_frequency(struct device *dev,
 }
 
 static ssize_t ade7753_write_frequency(struct device *dev,
-		struct device_attribute *attr,
-		const char *buf,
-		size_t len)
+				       struct device_attribute *attr,
+				       const char *buf,
+				       size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct ade7753_state *st = iio_priv(indio_dev);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions
  2017-05-09  1:49 ` [PATCH 0/3] coding style warnings fixes Harinath Nampally
  2017-05-09  1:49   ` [PATCH 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
  2017-05-09  1:49   ` [PATCH 2/3] staging: iio: meter: Fix the identations for proper alignments Harinath Nampally
@ 2017-05-09  1:49   ` Harinath Nampally
  2 siblings, 0 replies; 14+ messages in thread
From: Harinath Nampally @ 2017-05-09  1:49 UTC (permalink / raw)
  To: jsindhu81191; +Cc: harinath922, linux-kernel

This patch fixes below kind of warnings:
WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.

Below errors are false positives:
ade7753.c:382: ERROR: Use 4 digit octal (0777) not decimal permissions
ade7753.c:386: ERROR: Use 4 digit octal (0777) not decimal permissions

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---
 drivers/staging/iio/meter/ade7753.c | 46 ++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
index 5d45a68..2534bd0 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -298,92 +298,92 @@ static IIO_DEV_ATTR_AENERGY(ade7753_read_24bit, ADE7753_AENERGY);
 static IIO_DEV_ATTR_LAENERGY(ade7753_read_24bit, ADE7753_LAENERGY);
 static IIO_DEV_ATTR_VAENERGY(ade7753_read_24bit, ADE7753_VAENERGY);
 static IIO_DEV_ATTR_LVAENERGY(ade7753_read_24bit, ADE7753_LVAENERGY);
-static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFDEN(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_CFDEN);
-static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFNUM(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_CFNUM);
 static IIO_DEV_ATTR_CHKSUM(ade7753_read_8bit, ADE7753_CHKSUM);
-static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PHCAL(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_PHCAL);
-static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APOS(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_APOS);
-static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGCYC(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_SAGCYC);
-static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGLVL(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_SAGLVL);
-static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_LINECYC(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_LINECYC);
-static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_WDIV(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_WDIV);
-static IIO_DEV_ATTR_IRMS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IRMS(0644,
 		ade7753_read_24bit,
 		NULL,
 		ADE7753_IRMS);
-static IIO_DEV_ATTR_VRMS(S_IRUGO,
+static IIO_DEV_ATTR_VRMS(0444,
 		ade7753_read_24bit,
 		NULL,
 		ADE7753_VRMS);
-static IIO_DEV_ATTR_IRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IRMSOS(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_IRMSOS);
-static IIO_DEV_ATTR_VRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VRMSOS(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_VRMSOS);
-static IIO_DEV_ATTR_WGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_WGAIN(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_WGAIN);
-static IIO_DEV_ATTR_VAGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VAGAIN(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_VAGAIN);
-static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PGA_GAIN(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_GAIN);
-static IIO_DEV_ATTR_IPKLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IPKLVL(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_IPKLVL);
-static IIO_DEV_ATTR_VPKLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VPKLVL(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_VPKLVL);
-static IIO_DEV_ATTR_IPEAK(S_IRUGO,
+static IIO_DEV_ATTR_IPEAK(0444,
 		ade7753_read_24bit,
 		NULL,
 		ADE7753_IPEAK);
-static IIO_DEV_ATTR_VPEAK(S_IRUGO,
+static IIO_DEV_ATTR_VPEAK(0444,
 		ade7753_read_24bit,
 		NULL,
 		ADE7753_VPEAK);
-static IIO_DEV_ATTR_VPERIOD(S_IRUGO,
+static IIO_DEV_ATTR_VPERIOD(0444,
 		ade7753_read_16bit,
 		NULL,
 		ADE7753_PERIOD);
-static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(1, 0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_CH1OS);
-static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(2, 0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_CH2OS);
@@ -514,7 +514,7 @@ static IIO_DEV_ATTR_TEMP_RAW(ade7753_read_8bit);
 static IIO_CONST_ATTR(in_temp_offset, "-25 C");
 static IIO_CONST_ATTR(in_temp_scale, "0.67 C");
 
-static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAMP_FREQ(0644,
 		ade7753_read_frequency,
 		ade7753_write_frequency);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] staging: iio: meter: Add the comment for mutex definition
  2017-05-09  1:49   ` [PATCH 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
@ 2017-05-09  7:46     ` Dan Carpenter
  2017-05-09 23:41       ` [PATCH v2 0/3] coding style warnings fixes Harinath Nampally
  0 siblings, 1 reply; 14+ messages in thread
From: Dan Carpenter @ 2017-05-09  7:46 UTC (permalink / raw)
  To: Harinath Nampally
  Cc: lars, devel, Michael.Hennerich, linux-iio, gregkh, linux-kernel,
	pmeerw, knaack.h, jic23

On Mon, May 08, 2017 at 10:00:37PM -0400, Harinath Nampally wrote:
> This patch fixes below checkpatch.pl warning:
> CHECK: struct mutex definition without comment
> 
> Signed-off-by: Harinath Nampally <harinath922@gmail.com>
> ---
>  drivers/staging/iio/meter/ade7753.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
> index b71fbd3..cffe6bf 100644
> --- a/drivers/staging/iio/meter/ade7753.c
> +++ b/drivers/staging/iio/meter/ade7753.c
> @@ -78,12 +78,13 @@
>  /**
>   * struct ade7753_state - device instance specific data
>   * @us:         actual spi_device
> + * @buf_lock:       mutex to protect tx and rx
>   * @tx:         transmit buffer
>   * @rx:         receive buffer
> - * @buf_lock:       mutex to protect tx and rx
>   **/
>  struct ade7753_state {
>  	struct spi_device   *us;
> + /* mutex to protect tx and rx */

Not aligned.  We don't need two duplicate comments anyway.

>  	struct mutex        buf_lock;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 0/3] coding style warnings fixes
  2017-05-09  7:46     ` Dan Carpenter
@ 2017-05-09 23:41       ` Harinath Nampally
  2017-05-09 23:41         ` [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
                           ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Harinath Nampally @ 2017-05-09 23:41 UTC (permalink / raw)
  To: lars
  Cc: Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, linux-iio,
	devel, linux-kernel

This revised patchset is for improvement in [PATCH v2 1/3]
as per the code review comment from Dan Carpenter.

Other two patches [PATCH v2 2/3] and [PATCH v2 3/3] are unchanged,
so they are same as [PATCH 2/3] and [PATCH 3/3] respectively.

Please find the following related patches:
[PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition
[PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments
[PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions

Harinath Nampally (3):
  staging: iio: meter: Add the comment for mutex definition
  staging: iio: meter: Fix the identations for proper alignments    
  staging: iio: meter: Replace symbolic permissions with octal
    permissions 

 drivers/staging/iio/meter/ade7753.c | 104 ++++++++++++++++++------------------
 1 file changed, 51 insertions(+), 52 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition.
  2017-05-09 23:41       ` [PATCH v2 0/3] coding style warnings fixes Harinath Nampally
@ 2017-05-09 23:41         ` Harinath Nampally
  2017-05-14 15:24           ` Jonathan Cameron
  2017-05-09 23:41         ` [PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments Harinath Nampally
                           ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Harinath Nampally @ 2017-05-09 23:41 UTC (permalink / raw)
  To: lars
  Cc: Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, linux-iio,
	devel, linux-kernel

This patch fixes below checkpatch.pl warning:
CHECK: struct mutex definition without comment

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---
Changes in v2:
 - Removed the extra comment for mutex in the struct.
	
 drivers/staging/iio/meter/ade7753.c | 3 ++-
 1 file changed, 1 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
index b71fbd3..cffe6bf 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -78,12 +78,13 @@
 /**
  * struct ade7753_state - device instance specific data
  * @us:         actual spi_device
+ * @buf_lock:       mutex to protect tx and rx
  * @tx:         transmit buffer
  * @rx:         receive buffer
- * @buf_lock:       mutex to protect tx and rx
  **/
 struct ade7753_state {
 	struct spi_device   *us;
 	struct mutex        buf_lock;
 	u8          tx[ADE7753_MAX_TX] ____cacheline_aligned;
 	u8          rx[ADE7753_MAX_RX];
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments.
  2017-05-09 23:41       ` [PATCH v2 0/3] coding style warnings fixes Harinath Nampally
  2017-05-09 23:41         ` [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
@ 2017-05-09 23:41         ` Harinath Nampally
  2017-05-14 15:26           ` Jonathan Cameron
  2017-05-09 23:41         ` [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions Harinath Nampally
  2017-05-14 15:23         ` [PATCH v2 0/3] coding style warnings fixes Jonathan Cameron
  3 siblings, 1 reply; 14+ messages in thread
From: Harinath Nampally @ 2017-05-09 23:41 UTC (permalink / raw)
  To: lars
  Cc: Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, linux-iio,
	devel, linux-kernel

This patch fixes below checkpatch.pl kind of warnings:
CHECK: Alignment should match open parenthesis

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---
Changes in v2:
 - None because only [PATCH v2 1/3] has improvement

 drivers/staging/iio/meter/ade7753.c | 55 ++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
index cffe6bf..5d45a68 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -108,9 +108,8 @@ static int ade7753_spi_write_reg_8(struct device *dev,
 	return ret;
 }
 
-static int ade7753_spi_write_reg_16(struct device *dev,
-		u8 reg_address,
-		u16 value)
+static int ade7753_spi_write_reg_16(struct device *dev, u8 reg_address,
+				    u16 value)
 {
 	int ret;
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
@@ -127,8 +126,8 @@ static int ade7753_spi_write_reg_16(struct device *dev,
 }
 
 static int ade7753_spi_read_reg_8(struct device *dev,
-		u8 reg_address,
-		u8 *val)
+				  u8 reg_address,
+				  u8 *val)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct ade7753_state *st = iio_priv(indio_dev);
@@ -137,7 +136,7 @@ static int ade7753_spi_read_reg_8(struct device *dev,
 	ret = spi_w8r8(st->us, ADE7753_READ_REG(reg_address));
 	if (ret < 0) {
 		dev_err(&st->us->dev, "problem when reading 8 bit register 0x%02X",
-				reg_address);
+			reg_address);
 		return ret;
 	}
 	*val = ret;
@@ -146,8 +145,8 @@ static int ade7753_spi_read_reg_8(struct device *dev,
 }
 
 static int ade7753_spi_read_reg_16(struct device *dev,
-		u8 reg_address,
-		u16 *val)
+				   u8 reg_address,
+				   u16 *val)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct ade7753_state *st = iio_priv(indio_dev);
@@ -166,8 +165,8 @@ static int ade7753_spi_read_reg_16(struct device *dev,
 }
 
 static int ade7753_spi_read_reg_24(struct device *dev,
-		u8 reg_address,
-		u32 *val)
+				   u8 reg_address,
+				   u32 *val)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct ade7753_state *st = iio_priv(indio_dev);
@@ -190,7 +189,7 @@ static int ade7753_spi_read_reg_24(struct device *dev,
 	ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
 	if (ret) {
 		dev_err(&st->us->dev, "problem when reading 24 bit register 0x%02X",
-				reg_address);
+			reg_address);
 		goto error_ret;
 	}
 	*val = (st->rx[0] << 16) | (st->rx[1] << 8) | st->rx[2];
@@ -201,8 +200,8 @@ static int ade7753_spi_read_reg_24(struct device *dev,
 }
 
 static ssize_t ade7753_read_8bit(struct device *dev,
-		struct device_attribute *attr,
-		char *buf)
+				 struct device_attribute *attr,
+				 char *buf)
 {
 	int ret;
 	u8 val;
@@ -216,8 +215,8 @@ static ssize_t ade7753_read_8bit(struct device *dev,
 }
 
 static ssize_t ade7753_read_16bit(struct device *dev,
-		struct device_attribute *attr,
-		char *buf)
+				  struct device_attribute *attr,
+				  char *buf)
 {
 	int ret;
 	u16 val;
@@ -231,8 +230,8 @@ static ssize_t ade7753_read_16bit(struct device *dev,
 }
 
 static ssize_t ade7753_read_24bit(struct device *dev,
-		struct device_attribute *attr,
-		char *buf)
+				  struct device_attribute *attr,
+				  char *buf)
 {
 	int ret;
 	u32 val;
@@ -246,9 +245,9 @@ static ssize_t ade7753_read_24bit(struct device *dev,
 }
 
 static ssize_t ade7753_write_8bit(struct device *dev,
-		struct device_attribute *attr,
-		const char *buf,
-		size_t len)
+				  struct device_attribute *attr,
+				  const char *buf,
+				  size_t len)
 {
 	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
 	int ret;
@@ -264,9 +263,9 @@ static ssize_t ade7753_write_8bit(struct device *dev,
 }
 
 static ssize_t ade7753_write_16bit(struct device *dev,
-		struct device_attribute *attr,
-		const char *buf,
-		size_t len)
+				   struct device_attribute *attr,
+				   const char *buf,
+				   size_t len)
 {
 	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
 	int ret;
@@ -451,8 +450,8 @@ static int ade7753_initial_setup(struct iio_dev *indio_dev)
 }
 
 static ssize_t ade7753_read_frequency(struct device *dev,
-		struct device_attribute *attr,
-		char *buf)
+				      struct device_attribute *attr,
+				      char *buf)
 {
 	int ret;
 	u16 t;
@@ -469,9 +468,9 @@ static ssize_t ade7753_read_frequency(struct device *dev,
 }
 
 static ssize_t ade7753_write_frequency(struct device *dev,
-		struct device_attribute *attr,
-		const char *buf,
-		size_t len)
+				       struct device_attribute *attr,
+				       const char *buf,
+				       size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct ade7753_state *st = iio_priv(indio_dev);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions.
  2017-05-09 23:41       ` [PATCH v2 0/3] coding style warnings fixes Harinath Nampally
  2017-05-09 23:41         ` [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
  2017-05-09 23:41         ` [PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments Harinath Nampally
@ 2017-05-09 23:41         ` Harinath Nampally
  2017-05-14 15:29           ` Jonathan Cameron
  2017-05-14 15:23         ` [PATCH v2 0/3] coding style warnings fixes Jonathan Cameron
  3 siblings, 1 reply; 14+ messages in thread
From: Harinath Nampally @ 2017-05-09 23:41 UTC (permalink / raw)
  To: lars
  Cc: Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, linux-iio,
	devel, linux-kernel

This patch fixes below kind of warnings:
WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.

Below errors are false positives:
ade7753.c:382: ERROR: Use 4 digit octal (0777) not decimal permissions
ade7753.c:386: ERROR: Use 4 digit octal (0777) not decimal permissions

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---
Changes in v2:
 - None because only [PATCH v2 1/3] has improvement

 drivers/staging/iio/meter/ade7753.c | 46 ++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
index 5d45a68..2534bd0 100644
--- a/drivers/staging/iio/meter/ade7753.c
+++ b/drivers/staging/iio/meter/ade7753.c
@@ -298,92 +298,92 @@ static IIO_DEV_ATTR_AENERGY(ade7753_read_24bit, ADE7753_AENERGY);
 static IIO_DEV_ATTR_LAENERGY(ade7753_read_24bit, ADE7753_LAENERGY);
 static IIO_DEV_ATTR_VAENERGY(ade7753_read_24bit, ADE7753_VAENERGY);
 static IIO_DEV_ATTR_LVAENERGY(ade7753_read_24bit, ADE7753_LVAENERGY);
-static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFDEN(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_CFDEN);
-static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFNUM(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_CFNUM);
 static IIO_DEV_ATTR_CHKSUM(ade7753_read_8bit, ADE7753_CHKSUM);
-static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PHCAL(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_PHCAL);
-static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APOS(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_APOS);
-static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGCYC(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_SAGCYC);
-static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGLVL(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_SAGLVL);
-static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_LINECYC(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_LINECYC);
-static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_WDIV(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_WDIV);
-static IIO_DEV_ATTR_IRMS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IRMS(0644,
 		ade7753_read_24bit,
 		NULL,
 		ADE7753_IRMS);
-static IIO_DEV_ATTR_VRMS(S_IRUGO,
+static IIO_DEV_ATTR_VRMS(0444,
 		ade7753_read_24bit,
 		NULL,
 		ADE7753_VRMS);
-static IIO_DEV_ATTR_IRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IRMSOS(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_IRMSOS);
-static IIO_DEV_ATTR_VRMSOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VRMSOS(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_VRMSOS);
-static IIO_DEV_ATTR_WGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_WGAIN(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_WGAIN);
-static IIO_DEV_ATTR_VAGAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VAGAIN(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_VAGAIN);
-static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PGA_GAIN(0644,
 		ade7753_read_16bit,
 		ade7753_write_16bit,
 		ADE7753_GAIN);
-static IIO_DEV_ATTR_IPKLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_IPKLVL(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_IPKLVL);
-static IIO_DEV_ATTR_VPKLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_VPKLVL(0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_VPKLVL);
-static IIO_DEV_ATTR_IPEAK(S_IRUGO,
+static IIO_DEV_ATTR_IPEAK(0444,
 		ade7753_read_24bit,
 		NULL,
 		ADE7753_IPEAK);
-static IIO_DEV_ATTR_VPEAK(S_IRUGO,
+static IIO_DEV_ATTR_VPEAK(0444,
 		ade7753_read_24bit,
 		NULL,
 		ADE7753_VPEAK);
-static IIO_DEV_ATTR_VPERIOD(S_IRUGO,
+static IIO_DEV_ATTR_VPERIOD(0444,
 		ade7753_read_16bit,
 		NULL,
 		ADE7753_PERIOD);
-static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(1, 0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_CH1OS);
-static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(2, 0644,
 		ade7753_read_8bit,
 		ade7753_write_8bit,
 		ADE7753_CH2OS);
@@ -514,7 +514,7 @@ static IIO_DEV_ATTR_TEMP_RAW(ade7753_read_8bit);
 static IIO_CONST_ATTR(in_temp_offset, "-25 C");
 static IIO_CONST_ATTR(in_temp_scale, "0.67 C");
 
-static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAMP_FREQ(0644,
 		ade7753_read_frequency,
 		ade7753_write_frequency);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 0/3] coding style warnings fixes
  2017-05-09 23:41       ` [PATCH v2 0/3] coding style warnings fixes Harinath Nampally
                           ` (2 preceding siblings ...)
  2017-05-09 23:41         ` [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions Harinath Nampally
@ 2017-05-14 15:23         ` Jonathan Cameron
  3 siblings, 0 replies; 14+ messages in thread
From: Jonathan Cameron @ 2017-05-14 15:23 UTC (permalink / raw)
  To: Harinath Nampally, lars
  Cc: Michael.Hennerich, knaack.h, pmeerw, gregkh, linux-iio, devel,
	linux-kernel

On 10/05/17 00:41, Harinath Nampally wrote:
> This revised patchset is for improvement in [PATCH v2 1/3]
> as per the code review comment from Dan Carpenter.
> 
> Other two patches [PATCH v2 2/3] and [PATCH v2 3/3] are unchanged,
> so they are same as [PATCH 2/3] and [PATCH 3/3] respectively.
> 
> Please find the following related patches:
> [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition
> [PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments
> [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions
> 
> Harinath Nampally (3):
>    staging: iio: meter: Add the comment for mutex definition
>    staging: iio: meter: Fix the identations for proper alignments
>    staging: iio: meter: Replace symbolic permissions with octal
>      permissions
> 
>   drivers/staging/iio/meter/ade7753.c | 104 ++++++++++++++++++------------------
>   1 file changed, 51 insertions(+), 52 deletions(-)

Please don't post new versions of a patch series as a reply to earlier versions.
It very rapidly leads to deep and unmanageable threads!

Jonathan
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition.
  2017-05-09 23:41         ` [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
@ 2017-05-14 15:24           ` Jonathan Cameron
  0 siblings, 0 replies; 14+ messages in thread
From: Jonathan Cameron @ 2017-05-14 15:24 UTC (permalink / raw)
  To: Harinath Nampally, lars
  Cc: Michael.Hennerich, knaack.h, pmeerw, gregkh, linux-iio, devel,
	linux-kernel

On 10/05/17 00:41, Harinath Nampally wrote:
> This patch fixes below checkpatch.pl warning:
> CHECK: struct mutex definition without comment
> 
> Signed-off-by: Harinath Nampally <harinath922@gmail.com>
They description is no longer correct. This moves a comment
rather than adding one.

J
> ---
> Changes in v2:
>   - Removed the extra comment for mutex in the struct.
> 	
>   drivers/staging/iio/meter/ade7753.c | 3 ++-
>   1 file changed, 1 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
> index b71fbd3..cffe6bf 100644
> --- a/drivers/staging/iio/meter/ade7753.c
> +++ b/drivers/staging/iio/meter/ade7753.c
> @@ -78,12 +78,13 @@
>   /**
>    * struct ade7753_state - device instance specific data
>    * @us:         actual spi_device
> + * @buf_lock:       mutex to protect tx and rx
>    * @tx:         transmit buffer
>    * @rx:         receive buffer
> - * @buf_lock:       mutex to protect tx and rx
>    **/
>   struct ade7753_state {
>   	struct spi_device   *us;
>   	struct mutex        buf_lock;
>   	u8          tx[ADE7753_MAX_TX] ____cacheline_aligned;
>   	u8          rx[ADE7753_MAX_RX];
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments.
  2017-05-09 23:41         ` [PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments Harinath Nampally
@ 2017-05-14 15:26           ` Jonathan Cameron
  0 siblings, 0 replies; 14+ messages in thread
From: Jonathan Cameron @ 2017-05-14 15:26 UTC (permalink / raw)
  To: Harinath Nampally, lars
  Cc: Michael.Hennerich, knaack.h, pmeerw, gregkh, linux-iio, devel,
	linux-kernel

On 10/05/17 00:41, Harinath Nampally wrote:
> This patch fixes below checkpatch.pl kind of warnings:
> CHECK: Alignment should match open parenthesis
> 
> Signed-off-by: Harinath Nampally <harinath922@gmail.com>
Good patch and well described.

Applied this one (without patch 1) to the togreg branch of
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/
which is initially pushed out as testing for the autobuilders
to see if we've missed anything.

Thanks,

Jonathan
> ---
> Changes in v2:
>   - None because only [PATCH v2 1/3] has improvement
> 
>   drivers/staging/iio/meter/ade7753.c | 55 ++++++++++++++++++-------------------
>   1 file changed, 27 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
> index cffe6bf..5d45a68 100644
> --- a/drivers/staging/iio/meter/ade7753.c
> +++ b/drivers/staging/iio/meter/ade7753.c
> @@ -108,9 +108,8 @@ static int ade7753_spi_write_reg_8(struct device *dev,
>   	return ret;
>   }
>   
> -static int ade7753_spi_write_reg_16(struct device *dev,
> -		u8 reg_address,
> -		u16 value)
> +static int ade7753_spi_write_reg_16(struct device *dev, u8 reg_address,
> +				    u16 value)
>   {
>   	int ret;
>   	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> @@ -127,8 +126,8 @@ static int ade7753_spi_write_reg_16(struct device *dev,
>   }
>   
>   static int ade7753_spi_read_reg_8(struct device *dev,
> -		u8 reg_address,
> -		u8 *val)
> +				  u8 reg_address,
> +				  u8 *val)
>   {
>   	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>   	struct ade7753_state *st = iio_priv(indio_dev);
> @@ -137,7 +136,7 @@ static int ade7753_spi_read_reg_8(struct device *dev,
>   	ret = spi_w8r8(st->us, ADE7753_READ_REG(reg_address));
>   	if (ret < 0) {
>   		dev_err(&st->us->dev, "problem when reading 8 bit register 0x%02X",
> -				reg_address);
> +			reg_address);
>   		return ret;
>   	}
>   	*val = ret;
> @@ -146,8 +145,8 @@ static int ade7753_spi_read_reg_8(struct device *dev,
>   }
>   
>   static int ade7753_spi_read_reg_16(struct device *dev,
> -		u8 reg_address,
> -		u16 *val)
> +				   u8 reg_address,
> +				   u16 *val)
>   {
>   	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>   	struct ade7753_state *st = iio_priv(indio_dev);
> @@ -166,8 +165,8 @@ static int ade7753_spi_read_reg_16(struct device *dev,
>   }
>   
>   static int ade7753_spi_read_reg_24(struct device *dev,
> -		u8 reg_address,
> -		u32 *val)
> +				   u8 reg_address,
> +				   u32 *val)
>   {
>   	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>   	struct ade7753_state *st = iio_priv(indio_dev);
> @@ -190,7 +189,7 @@ static int ade7753_spi_read_reg_24(struct device *dev,
>   	ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
>   	if (ret) {
>   		dev_err(&st->us->dev, "problem when reading 24 bit register 0x%02X",
> -				reg_address);
> +			reg_address);
>   		goto error_ret;
>   	}
>   	*val = (st->rx[0] << 16) | (st->rx[1] << 8) | st->rx[2];
> @@ -201,8 +200,8 @@ static int ade7753_spi_read_reg_24(struct device *dev,
>   }
>   
>   static ssize_t ade7753_read_8bit(struct device *dev,
> -		struct device_attribute *attr,
> -		char *buf)
> +				 struct device_attribute *attr,
> +				 char *buf)
>   {
>   	int ret;
>   	u8 val;
> @@ -216,8 +215,8 @@ static ssize_t ade7753_read_8bit(struct device *dev,
>   }
>   
>   static ssize_t ade7753_read_16bit(struct device *dev,
> -		struct device_attribute *attr,
> -		char *buf)
> +				  struct device_attribute *attr,
> +				  char *buf)
>   {
>   	int ret;
>   	u16 val;
> @@ -231,8 +230,8 @@ static ssize_t ade7753_read_16bit(struct device *dev,
>   }
>   
>   static ssize_t ade7753_read_24bit(struct device *dev,
> -		struct device_attribute *attr,
> -		char *buf)
> +				  struct device_attribute *attr,
> +				  char *buf)
>   {
>   	int ret;
>   	u32 val;
> @@ -246,9 +245,9 @@ static ssize_t ade7753_read_24bit(struct device *dev,
>   }
>   
>   static ssize_t ade7753_write_8bit(struct device *dev,
> -		struct device_attribute *attr,
> -		const char *buf,
> -		size_t len)
> +				  struct device_attribute *attr,
> +				  const char *buf,
> +				  size_t len)
>   {
>   	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
>   	int ret;
> @@ -264,9 +263,9 @@ static ssize_t ade7753_write_8bit(struct device *dev,
>   }
>   
>   static ssize_t ade7753_write_16bit(struct device *dev,
> -		struct device_attribute *attr,
> -		const char *buf,
> -		size_t len)
> +				   struct device_attribute *attr,
> +				   const char *buf,
> +				   size_t len)
>   {
>   	struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
>   	int ret;
> @@ -451,8 +450,8 @@ static int ade7753_initial_setup(struct iio_dev *indio_dev)
>   }
>   
>   static ssize_t ade7753_read_frequency(struct device *dev,
> -		struct device_attribute *attr,
> -		char *buf)
> +				      struct device_attribute *attr,
> +				      char *buf)
>   {
>   	int ret;
>   	u16 t;
> @@ -469,9 +468,9 @@ static ssize_t ade7753_read_frequency(struct device *dev,
>   }
>   
>   static ssize_t ade7753_write_frequency(struct device *dev,
> -		struct device_attribute *attr,
> -		const char *buf,
> -		size_t len)
> +				       struct device_attribute *attr,
> +				       const char *buf,
> +				       size_t len)
>   {
>   	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>   	struct ade7753_state *st = iio_priv(indio_dev);
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions.
  2017-05-09 23:41         ` [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions Harinath Nampally
@ 2017-05-14 15:29           ` Jonathan Cameron
  2017-05-15  3:10             ` harinath Nampally
  0 siblings, 1 reply; 14+ messages in thread
From: Jonathan Cameron @ 2017-05-14 15:29 UTC (permalink / raw)
  To: Harinath Nampally, lars
  Cc: Michael.Hennerich, knaack.h, pmeerw, gregkh, linux-iio, devel,
	linux-kernel

On 10/05/17 00:41, Harinath Nampally wrote:
> This patch fixes below kind of warnings:
> WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.
> 
> Below errors are false positives:
> ade7753.c:382: ERROR: Use 4 digit octal (0777) not decimal permissions
> ade7753.c:386: ERROR: Use 4 digit octal (0777) not decimal permissions
> 
> Signed-off-by: Harinath Nampally <harinath922@gmail.com>
I've already taken a patch for this.

For IIO patches (including for drivers in staging) please also
check the iio.git tree and in particularly base the on the togreg branch
of that unless you know something you need is in the testing branch
(usually more recent) in which case use that.  This stuff all gets
batched up every few weeks and sent as a pull request to Greg.
Right now we have just ended a merge window so it's the longest gap
that typically occurs in these going to Greg.

Thanks,

Jonathan
> ---
> Changes in v2:
>   - None because only [PATCH v2 1/3] has improvement
> 
>   drivers/staging/iio/meter/ade7753.c | 46 ++++++++++++++++++-------------------
>   1 file changed, 23 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c
> index 5d45a68..2534bd0 100644
> --- a/drivers/staging/iio/meter/ade7753.c
> +++ b/drivers/staging/iio/meter/ade7753.c
> @@ -298,92 +298,92 @@ static IIO_DEV_ATTR_AENERGY(ade7753_read_24bit, ADE7753_AENERGY);
>   static IIO_DEV_ATTR_LAENERGY(ade7753_read_24bit, ADE7753_LAENERGY);
>   static IIO_DEV_ATTR_VAENERGY(ade7753_read_24bit, ADE7753_VAENERGY);
>   static IIO_DEV_ATTR_LVAENERGY(ade7753_read_24bit, ADE7753_LVAENERGY);
> -static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CFDEN(0644,
>   		ade7753_read_16bit,
>   		ade7753_write_16bit,
>   		ADE7753_CFDEN);
> -static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CFNUM(0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_CFNUM);
>   static IIO_DEV_ATTR_CHKSUM(ade7753_read_8bit, ADE7753_CHKSUM);
> -static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_PHCAL(0644,
>   		ade7753_read_16bit,
>   		ade7753_write_16bit,
>   		ADE7753_PHCAL);
> -static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_APOS(0644,
>   		ade7753_read_16bit,
>   		ade7753_write_16bit,
>   		ADE7753_APOS);
> -static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAGCYC(0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_SAGCYC);
> -static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAGLVL(0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_SAGLVL);
> -static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_LINECYC(0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_LINECYC);
> -static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_WDIV(0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_WDIV);
> -static IIO_DEV_ATTR_IRMS(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_IRMS(0644,
>   		ade7753_read_24bit,
>   		NULL,
>   		ADE7753_IRMS);
> -static IIO_DEV_ATTR_VRMS(S_IRUGO,
> +static IIO_DEV_ATTR_VRMS(0444,
>   		ade7753_read_24bit,
>   		NULL,
>   		ADE7753_VRMS);
> -static IIO_DEV_ATTR_IRMSOS(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_IRMSOS(0644,
>   		ade7753_read_16bit,
>   		ade7753_write_16bit,
>   		ADE7753_IRMSOS);
> -static IIO_DEV_ATTR_VRMSOS(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_VRMSOS(0644,
>   		ade7753_read_16bit,
>   		ade7753_write_16bit,
>   		ADE7753_VRMSOS);
> -static IIO_DEV_ATTR_WGAIN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_WGAIN(0644,
>   		ade7753_read_16bit,
>   		ade7753_write_16bit,
>   		ADE7753_WGAIN);
> -static IIO_DEV_ATTR_VAGAIN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_VAGAIN(0644,
>   		ade7753_read_16bit,
>   		ade7753_write_16bit,
>   		ADE7753_VAGAIN);
> -static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_PGA_GAIN(0644,
>   		ade7753_read_16bit,
>   		ade7753_write_16bit,
>   		ADE7753_GAIN);
> -static IIO_DEV_ATTR_IPKLVL(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_IPKLVL(0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_IPKLVL);
> -static IIO_DEV_ATTR_VPKLVL(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_VPKLVL(0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_VPKLVL);
> -static IIO_DEV_ATTR_IPEAK(S_IRUGO,
> +static IIO_DEV_ATTR_IPEAK(0444,
>   		ade7753_read_24bit,
>   		NULL,
>   		ADE7753_IPEAK);
> -static IIO_DEV_ATTR_VPEAK(S_IRUGO,
> +static IIO_DEV_ATTR_VPEAK(0444,
>   		ade7753_read_24bit,
>   		NULL,
>   		ADE7753_VPEAK);
> -static IIO_DEV_ATTR_VPERIOD(S_IRUGO,
> +static IIO_DEV_ATTR_VPERIOD(0444,
>   		ade7753_read_16bit,
>   		NULL,
>   		ADE7753_PERIOD);
> -static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CH_OFF(1, 0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_CH1OS);
> -static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CH_OFF(2, 0644,
>   		ade7753_read_8bit,
>   		ade7753_write_8bit,
>   		ADE7753_CH2OS);
> @@ -514,7 +514,7 @@ static IIO_DEV_ATTR_TEMP_RAW(ade7753_read_8bit);
>   static IIO_CONST_ATTR(in_temp_offset, "-25 C");
>   static IIO_CONST_ATTR(in_temp_scale, "0.67 C");
>   
> -static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAMP_FREQ(0644,
>   		ade7753_read_frequency,
>   		ade7753_write_frequency);
>   
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions.
  2017-05-14 15:29           ` Jonathan Cameron
@ 2017-05-15  3:10             ` harinath Nampally
  0 siblings, 0 replies; 14+ messages in thread
From: harinath Nampally @ 2017-05-15  3:10 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: lars, Michael.Hennerich, knaack.h, Peter Meerwald-Stadler,
	Greg KH, linux-iio, devel, linux-kernel

Jonathan,

Thank you for letting me know. In future I will work on 'togreg' branch
of iio.git tree to send my patches.

Thanks,
Harinath

On Sun, May 14, 2017 at 11:29 AM, Jonathan Cameron <jic23@kernel.org> wrote:
> On 10/05/17 00:41, Harinath Nampally wrote:
>>
>> This patch fixes below kind of warnings:
>> WARNING: Symbolic permissions 'S_IXXX | S_IXXX' are not preferred.
>>
>> Below errors are false positives:
>> ade7753.c:382: ERROR: Use 4 digit octal (0777) not decimal permissions
>> ade7753.c:386: ERROR: Use 4 digit octal (0777) not decimal permissions
>>
>> Signed-off-by: Harinath Nampally <harinath922@gmail.com>
>
> I've already taken a patch for this.
>
> For IIO patches (including for drivers in staging) please also
> check the iio.git tree and in particularly base the on the togreg branch
> of that unless you know something you need is in the testing branch
> (usually more recent) in which case use that.  This stuff all gets
> batched up every few weeks and sent as a pull request to Greg.
> Right now we have just ended a merge window so it's the longest gap
> that typically occurs in these going to Greg.
>
> Thanks,
>
> Jonathan
>
>> ---
>> Changes in v2:
>>   - None because only [PATCH v2 1/3] has improvement
>>
>>   drivers/staging/iio/meter/ade7753.c | 46
>> ++++++++++++++++++-------------------
>>   1 file changed, 23 insertions(+), 23 deletions(-)
>>
>> diff --git a/drivers/staging/iio/meter/ade7753.c
>> b/drivers/staging/iio/meter/ade7753.c
>> index 5d45a68..2534bd0 100644
>> --- a/drivers/staging/iio/meter/ade7753.c
>> +++ b/drivers/staging/iio/meter/ade7753.c
>> @@ -298,92 +298,92 @@ static IIO_DEV_ATTR_AENERGY(ade7753_read_24bit,
>> ADE7753_AENERGY);
>>   static IIO_DEV_ATTR_LAENERGY(ade7753_read_24bit, ADE7753_LAENERGY);
>>   static IIO_DEV_ATTR_VAENERGY(ade7753_read_24bit, ADE7753_VAENERGY);
>>   static IIO_DEV_ATTR_LVAENERGY(ade7753_read_24bit, ADE7753_LVAENERGY);
>> -static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_CFDEN(0644,
>>                 ade7753_read_16bit,
>>                 ade7753_write_16bit,
>>                 ADE7753_CFDEN);
>> -static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_CFNUM(0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_CFNUM);
>>   static IIO_DEV_ATTR_CHKSUM(ade7753_read_8bit, ADE7753_CHKSUM);
>> -static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_PHCAL(0644,
>>                 ade7753_read_16bit,
>>                 ade7753_write_16bit,
>>                 ADE7753_PHCAL);
>> -static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_APOS(0644,
>>                 ade7753_read_16bit,
>>                 ade7753_write_16bit,
>>                 ADE7753_APOS);
>> -static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_SAGCYC(0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_SAGCYC);
>> -static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_SAGLVL(0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_SAGLVL);
>> -static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_LINECYC(0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_LINECYC);
>> -static IIO_DEV_ATTR_WDIV(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_WDIV(0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_WDIV);
>> -static IIO_DEV_ATTR_IRMS(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_IRMS(0644,
>>                 ade7753_read_24bit,
>>                 NULL,
>>                 ADE7753_IRMS);
>> -static IIO_DEV_ATTR_VRMS(S_IRUGO,
>> +static IIO_DEV_ATTR_VRMS(0444,
>>                 ade7753_read_24bit,
>>                 NULL,
>>                 ADE7753_VRMS);
>> -static IIO_DEV_ATTR_IRMSOS(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_IRMSOS(0644,
>>                 ade7753_read_16bit,
>>                 ade7753_write_16bit,
>>                 ADE7753_IRMSOS);
>> -static IIO_DEV_ATTR_VRMSOS(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_VRMSOS(0644,
>>                 ade7753_read_16bit,
>>                 ade7753_write_16bit,
>>                 ADE7753_VRMSOS);
>> -static IIO_DEV_ATTR_WGAIN(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_WGAIN(0644,
>>                 ade7753_read_16bit,
>>                 ade7753_write_16bit,
>>                 ADE7753_WGAIN);
>> -static IIO_DEV_ATTR_VAGAIN(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_VAGAIN(0644,
>>                 ade7753_read_16bit,
>>                 ade7753_write_16bit,
>>                 ADE7753_VAGAIN);
>> -static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_PGA_GAIN(0644,
>>                 ade7753_read_16bit,
>>                 ade7753_write_16bit,
>>                 ADE7753_GAIN);
>> -static IIO_DEV_ATTR_IPKLVL(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_IPKLVL(0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_IPKLVL);
>> -static IIO_DEV_ATTR_VPKLVL(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_VPKLVL(0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_VPKLVL);
>> -static IIO_DEV_ATTR_IPEAK(S_IRUGO,
>> +static IIO_DEV_ATTR_IPEAK(0444,
>>                 ade7753_read_24bit,
>>                 NULL,
>>                 ADE7753_IPEAK);
>> -static IIO_DEV_ATTR_VPEAK(S_IRUGO,
>> +static IIO_DEV_ATTR_VPEAK(0444,
>>                 ade7753_read_24bit,
>>                 NULL,
>>                 ADE7753_VPEAK);
>> -static IIO_DEV_ATTR_VPERIOD(S_IRUGO,
>> +static IIO_DEV_ATTR_VPERIOD(0444,
>>                 ade7753_read_16bit,
>>                 NULL,
>>                 ADE7753_PERIOD);
>> -static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_CH_OFF(1, 0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_CH1OS);
>> -static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_CH_OFF(2, 0644,
>>                 ade7753_read_8bit,
>>                 ade7753_write_8bit,
>>                 ADE7753_CH2OS);
>> @@ -514,7 +514,7 @@ static IIO_DEV_ATTR_TEMP_RAW(ade7753_read_8bit);
>>   static IIO_CONST_ATTR(in_temp_offset, "-25 C");
>>   static IIO_CONST_ATTR(in_temp_scale, "0.67 C");
>>   -static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
>> +static IIO_DEV_ATTR_SAMP_FREQ(0644,
>>                 ade7753_read_frequency,
>>                 ade7753_write_frequency);
>>
>
>



-- 
Thanks,
Harinath
+1 312 560 8565

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-05-15  3:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1494215850-26005-1-git-send-email-harinath922@gmail.com>
2017-05-09  1:49 ` [PATCH 0/3] coding style warnings fixes Harinath Nampally
2017-05-09  1:49   ` [PATCH 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
2017-05-09  7:46     ` Dan Carpenter
2017-05-09 23:41       ` [PATCH v2 0/3] coding style warnings fixes Harinath Nampally
2017-05-09 23:41         ` [PATCH v2 1/3] staging: iio: meter: Add the comment for mutex definition Harinath Nampally
2017-05-14 15:24           ` Jonathan Cameron
2017-05-09 23:41         ` [PATCH v2 2/3] staging: iio: meter: Fix the identations for proper alignments Harinath Nampally
2017-05-14 15:26           ` Jonathan Cameron
2017-05-09 23:41         ` [PATCH v2 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions Harinath Nampally
2017-05-14 15:29           ` Jonathan Cameron
2017-05-15  3:10             ` harinath Nampally
2017-05-14 15:23         ` [PATCH v2 0/3] coding style warnings fixes Jonathan Cameron
2017-05-09  1:49   ` [PATCH 2/3] staging: iio: meter: Fix the identations for proper alignments Harinath Nampally
2017-05-09  1:49   ` [PATCH 3/3] staging: iio: meter: Replace symbolic permissions with octal permissions Harinath Nampally

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).