All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO)
@ 2017-04-04  2:13 Chen Guanqiao
  2017-04-08 17:01 ` Jonathan Cameron
  2017-04-09  4:30 ` [PATCH v3 0/2] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
  0 siblings, 2 replies; 10+ messages in thread
From: Chen Guanqiao @ 2017-04-04  2:13 UTC (permalink / raw)
  To: jic23, pmeerw; +Cc: Michael.Hennerich, linux-iio

Removing use of deprecated macros(S_IRUGO, S_IWUSR, S_IXUGO), and replace
with 4 digit octal.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
---
 drivers/staging/iio/meter/ade7759.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
index 0b65f1847510..dbd106f28cb7 100644
--- a/drivers/staging/iio/meter/ade7759.c
+++ b/drivers/staging/iio/meter/ade7759.c
@@ -279,49 +279,51 @@ static int ade7759_reset(struct device *dev)
 }
 
 static IIO_DEV_ATTR_AENERGY(ade7759_read_40bit, ADE7759_AENERGY);
-static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFDEN(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_CFDEN);
-static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFNUM(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_CFNUM);
 static IIO_DEV_ATTR_CHKSUM(ade7759_read_8bit, ADE7759_CHKSUM);
-static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PHCAL(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_PHCAL);
-static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APOS(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_APOS);
-static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGCYC(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_SAGCYC);
-static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGLVL(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_SAGLVL);
-static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_LINECYC(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_LINECYC);
 static IIO_DEV_ATTR_LENERGY(ade7759_read_40bit, ADE7759_LENERGY);
-static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PGA_GAIN(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_GAIN);
-static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_APGAIN);
-static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(
+		1, 0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_CH1OS);
-static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(
+		2, 0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_CH2OS);
@@ -458,7 +460,7 @@ static IIO_DEV_ATTR_TEMP_RAW(ade7759_read_8bit);
 static IIO_CONST_ATTR(in_temp_offset, "70 C");
 static IIO_CONST_ATTR(in_temp_scale, "1 C");
 
-static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAMP_FREQ(0644,
 		ade7759_read_frequency,
 		ade7759_write_frequency);
 
-- 
2.11.0

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

* Re: [PATCH v2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO)
  2017-04-04  2:13 [PATCH v2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO) Chen Guanqiao
@ 2017-04-08 17:01 ` Jonathan Cameron
  2017-04-09  4:30 ` [PATCH v3 0/2] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
  1 sibling, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2017-04-08 17:01 UTC (permalink / raw)
  To: Chen Guanqiao, pmeerw; +Cc: Michael.Hennerich, linux-iio

On 04/04/17 03:13, Chen Guanqiao wrote:
> Removing use of deprecated macros(S_IRUGO, S_IWUSR, S_IXUGO), and replace
> with 4 digit octal.
> 
> Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
Not keen on the reformatting...  However, there is an obvious way to clean
it up further whilst you are here.

Jonathan
> ---
>  drivers/staging/iio/meter/ade7759.c | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
> index 0b65f1847510..dbd106f28cb7 100644
> --- a/drivers/staging/iio/meter/ade7759.c
> +++ b/drivers/staging/iio/meter/ade7759.c
> @@ -279,49 +279,51 @@ static int ade7759_reset(struct device *dev)
>  }
>  
>  static IIO_DEV_ATTR_AENERGY(ade7759_read_40bit, ADE7759_AENERGY);
> -static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CFDEN(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_CFDEN);
> -static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CFNUM(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_CFNUM);
>  static IIO_DEV_ATTR_CHKSUM(ade7759_read_8bit, ADE7759_CHKSUM);
> -static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_PHCAL(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_PHCAL);
> -static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_APOS(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_APOS);
> -static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAGCYC(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_SAGCYC);
> -static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAGLVL(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_SAGLVL);
> -static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_LINECYC(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_LINECYC);
>  static IIO_DEV_ATTR_LENERGY(ade7759_read_40bit, ADE7759_LENERGY);
> -static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_PGA_GAIN(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_GAIN);
> -static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_APGAIN);
> -static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CH_OFF(
> +		1, 0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_CH1OS);
> -static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CH_OFF(
> +		2, 0644,

static IIO_DEV_ATTR_CH_OFF(2, 0644,
and realign the rest with opening bracket.  Make sure you update the
title and patch description to reflect this.
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_CH2OS);
> @@ -458,7 +460,7 @@ static IIO_DEV_ATTR_TEMP_RAW(ade7759_read_8bit);
>  static IIO_CONST_ATTR(in_temp_offset, "70 C");
>  static IIO_CONST_ATTR(in_temp_scale, "1 C");
>  
> -static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAMP_FREQ(0644,
>  		ade7759_read_frequency,
>  		ade7759_write_frequency);
>  
> 


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

* [PATCH v3 0/2] iio:meter:ade7759: use 4-digit octal permissions
  2017-04-04  2:13 [PATCH v2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO) Chen Guanqiao
  2017-04-08 17:01 ` Jonathan Cameron
@ 2017-04-09  4:30 ` Chen Guanqiao
  2017-04-09  4:30   ` [PATCH v3 1/2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO) Chen Guanqiao
  2017-04-09  4:30   ` [PATCH v3 2/2] iio:meter:ade7759: realign the rest with opening bracket Chen Guanqiao
  1 sibling, 2 replies; 10+ messages in thread
From: Chen Guanqiao @ 2017-04-09  4:30 UTC (permalink / raw)
  To: pmeerw, jic23; +Cc: Michael.Hennerich, linux-iio, Chen Guanqiao

This patch that fixes coding style problem.

version 3:
- update the title and patch scription
- divide the patch into two parts

version 2:
- corrected spelling error


Chen Guanqiao (2):
  iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO,
    S_IWUSR, S_IXUGO)
  iio:meter:ade7759: realign the rest with opening bracket

 drivers/staging/iio/meter/ade7759.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

--
2.11.0

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

* [PATCH v3 1/2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO)
  2017-04-09  4:30 ` [PATCH v3 0/2] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
@ 2017-04-09  4:30   ` Chen Guanqiao
  2017-04-09  8:18     ` Jonathan Cameron
  2017-04-09  4:30   ` [PATCH v3 2/2] iio:meter:ade7759: realign the rest with opening bracket Chen Guanqiao
  1 sibling, 1 reply; 10+ messages in thread
From: Chen Guanqiao @ 2017-04-09  4:30 UTC (permalink / raw)
  To: pmeerw, jic23; +Cc: Michael.Hennerich, linux-iio, Chen Guanqiao

Removing use of deprecated macros(S_IRUGO, S_IWUSR, S_IXUGO), and replace
with 4 digit octal.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
---
 drivers/staging/iio/meter/ade7759.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
index 0b65f1847510..68405046dae3 100644
--- a/drivers/staging/iio/meter/ade7759.c
+++ b/drivers/staging/iio/meter/ade7759.c
@@ -279,41 +279,41 @@ static int ade7759_reset(struct device *dev)
 }
 
 static IIO_DEV_ATTR_AENERGY(ade7759_read_40bit, ADE7759_AENERGY);
-static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFDEN(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_CFDEN);
-static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CFNUM(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_CFNUM);
 static IIO_DEV_ATTR_CHKSUM(ade7759_read_8bit, ADE7759_CHKSUM);
-static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PHCAL(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_PHCAL);
-static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_APOS(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_APOS);
-static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGCYC(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_SAGCYC);
-static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAGLVL(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_SAGLVL);
-static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_LINECYC(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_LINECYC);
 static IIO_DEV_ATTR_LENERGY(ade7759_read_40bit, ADE7759_LENERGY);
-static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_PGA_GAIN(0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_GAIN);
-static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_APGAIN);
@@ -458,7 +458,7 @@ static IIO_DEV_ATTR_TEMP_RAW(ade7759_read_8bit);
 static IIO_CONST_ATTR(in_temp_offset, "70 C");
 static IIO_CONST_ATTR(in_temp_scale, "1 C");
 
-static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAMP_FREQ(0644,
 		ade7759_read_frequency,
 		ade7759_write_frequency);
 
-- 
2.11.0




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

* [PATCH v3 2/2] iio:meter:ade7759: realign the rest with opening bracket
  2017-04-09  4:30 ` [PATCH v3 0/2] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
  2017-04-09  4:30   ` [PATCH v3 1/2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO) Chen Guanqiao
@ 2017-04-09  4:30   ` Chen Guanqiao
  2017-04-09  8:26     ` Jonathan Cameron
  2017-04-09 15:20     ` [PATCH v4 0/1] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
  1 sibling, 2 replies; 10+ messages in thread
From: Chen Guanqiao @ 2017-04-09  4:30 UTC (permalink / raw)
  To: pmeerw, jic23; +Cc: Michael.Hennerich, linux-iio, Chen Guanqiao

This fixes the coding style issue of using (S_IWUSR | S_IRUGO) in place of
4-digit octal numbers with realign the rest with opening bracket.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
---
 drivers/staging/iio/meter/ade7759.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
index 68405046dae3..9ddfa4ec7da9 100644
--- a/drivers/staging/iio/meter/ade7759.c
+++ b/drivers/staging/iio/meter/ade7759.c
@@ -317,11 +317,15 @@ static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_APGAIN);
-static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(
+		1,
+		0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_CH1OS);
-static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(
+		2,
+		0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_CH2OS);
-- 
2.11.0

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

* Re: [PATCH v3 1/2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO)
  2017-04-09  4:30   ` [PATCH v3 1/2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO) Chen Guanqiao
@ 2017-04-09  8:18     ` Jonathan Cameron
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2017-04-09  8:18 UTC (permalink / raw)
  To: Chen Guanqiao, pmeerw; +Cc: Michael.Hennerich, linux-iio

On 09/04/17 05:30, Chen Guanqiao wrote:
> Removing use of deprecated macros(S_IRUGO, S_IWUSR, S_IXUGO), and replace
> with 4 digit octal.
> 
> Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
Applied to the togreg ranch of iio.git and pushed out as testing
for the autobuilders to see if they can find anything we have missed.

Jonathan
> ---
>  drivers/staging/iio/meter/ade7759.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
> index 0b65f1847510..68405046dae3 100644
> --- a/drivers/staging/iio/meter/ade7759.c
> +++ b/drivers/staging/iio/meter/ade7759.c
> @@ -279,41 +279,41 @@ static int ade7759_reset(struct device *dev)
>  }
>  
>  static IIO_DEV_ATTR_AENERGY(ade7759_read_40bit, ADE7759_AENERGY);
> -static IIO_DEV_ATTR_CFDEN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CFDEN(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_CFDEN);
> -static IIO_DEV_ATTR_CFNUM(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CFNUM(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_CFNUM);
>  static IIO_DEV_ATTR_CHKSUM(ade7759_read_8bit, ADE7759_CHKSUM);
> -static IIO_DEV_ATTR_PHCAL(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_PHCAL(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_PHCAL);
> -static IIO_DEV_ATTR_APOS(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_APOS(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_APOS);
> -static IIO_DEV_ATTR_SAGCYC(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAGCYC(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_SAGCYC);
> -static IIO_DEV_ATTR_SAGLVL(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAGLVL(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_SAGLVL);
> -static IIO_DEV_ATTR_LINECYC(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_LINECYC(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_LINECYC);
>  static IIO_DEV_ATTR_LENERGY(ade7759_read_40bit, ADE7759_LENERGY);
> -static IIO_DEV_ATTR_PGA_GAIN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_PGA_GAIN(0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_GAIN);
> -static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_APGAIN);
> @@ -458,7 +458,7 @@ static IIO_DEV_ATTR_TEMP_RAW(ade7759_read_8bit);
>  static IIO_CONST_ATTR(in_temp_offset, "70 C");
>  static IIO_CONST_ATTR(in_temp_scale, "1 C");
>  
> -static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_SAMP_FREQ(0644,
>  		ade7759_read_frequency,
>  		ade7759_write_frequency);
>  
> 


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

* Re: [PATCH v3 2/2] iio:meter:ade7759: realign the rest with opening bracket
  2017-04-09  4:30   ` [PATCH v3 2/2] iio:meter:ade7759: realign the rest with opening bracket Chen Guanqiao
@ 2017-04-09  8:26     ` Jonathan Cameron
  2017-04-09 15:20     ` [PATCH v4 0/1] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
  1 sibling, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2017-04-09  8:26 UTC (permalink / raw)
  To: Chen Guanqiao, pmeerw; +Cc: Michael.Hennerich, linux-iio

On 09/04/17 05:30, Chen Guanqiao wrote:
> This fixes the coding style issue of using (S_IWUSR | S_IRUGO) in place of
> 4-digit octal numbers with realign the rest with opening bracket.
> 
> Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
Sorry, nope.  That wasn't what I meant.  The parameters should stay on the
first line, but the later parameters should then be aligned with the first
ones.

e.g.
static IIO_DEV_ATTR_CH_OFF(1, 0644,
			   ade7759_read_8bit,
			   ade7759_write_8bit,
			   ADE7759_CH10S);

or given the multiple line format doesn't really help with readability...
static IIO_DEV_ATTR_CH_OFF(1, 0644, ade7759_read_8bit, ade7759_write_8bit,
			   ADE7759_CH10S);

Key bit is aligning with the opening bracket.

First patch is now applied, so just post the update of this one if you
want to tidy this up.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/meter/ade7759.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
> index 68405046dae3..9ddfa4ec7da9 100644
> --- a/drivers/staging/iio/meter/ade7759.c
> +++ b/drivers/staging/iio/meter/ade7759.c
> @@ -317,11 +317,15 @@ static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_APGAIN);
> -static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CH_OFF(
> +		1,
> +		0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_CH1OS);
> -static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CH_OFF(
> +		2,
> +		0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_CH2OS);
> 


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

* [PATCH v4 0/1] iio:meter:ade7759: use 4-digit octal permissions
  2017-04-09  4:30   ` [PATCH v3 2/2] iio:meter:ade7759: realign the rest with opening bracket Chen Guanqiao
  2017-04-09  8:26     ` Jonathan Cameron
@ 2017-04-09 15:20     ` Chen Guanqiao
  2017-04-09 15:21       ` [PATCH v4 1/1] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR) Chen Guanqiao
  1 sibling, 1 reply; 10+ messages in thread
From: Chen Guanqiao @ 2017-04-09 15:20 UTC (permalink / raw)
  To: pmeerw, jic23; +Cc: Michael.Hennerich, linux-iio, Chen Guanqiao

This patch that fixes coding style problem.

Please note:
the checkpatch.pl will be reports error:
>ERROR: Use 4 digit octal (0777) not decimal permissions
>#320: FILE: drivers/staging/iio/meter/ade7759.c:320:
>+static IIO_DEV_ATTR_CH_OFF(1,
>+						   0644,
>+						   ade7759_read_8bit,
>+						   ade7759_write_8bit,
>+						   ADE7759_CH1OS);
>ERROR: Use 4 digit octal (0777) not decimal permissions
>#325: FILE: drivers/staging/iio/meter/ade7759.c:325:
>+static IIO_DEV_ATTR_CH_OFF(2,
>+						   0644,
>+						   ade7759_read_8bit,
>+						   ade7759_write_8bit,
>+						   ADE7759_CH2OS);
Because the script checks the first parameter as permissions in function like
"IIO_DEV_ATTR_[A-Z_]+" and the IIO_DEV_ATTR_CH_OFF permissions parameter is
second.

So, I think this is a problem of checkpatch.pl.

version 4:
- fixes the IIO_DEV_ATTR_CH_OFF

version 3:
- update the title and patch scription
- divide the patch into two parts

version 2:
- corrected spelling error

Chen Guanqiao (1):
  iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO,
    S_IWUSR)

 drivers/staging/iio/meter/ade7759.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.11.0




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

* [PATCH v4 1/1] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR)
  2017-04-09 15:20     ` [PATCH v4 0/1] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
@ 2017-04-09 15:21       ` Chen Guanqiao
  2017-04-14 14:04         ` Jonathan Cameron
  0 siblings, 1 reply; 10+ messages in thread
From: Chen Guanqiao @ 2017-04-09 15:21 UTC (permalink / raw)
  To: pmeerw, jic23; +Cc: Michael.Hennerich, linux-iio, Chen Guanqiao

This fixes the coding style issue of using (S_IWUSR | S_IRUGO) in place of
4-digit octal numbers.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
---
 drivers/staging/iio/meter/ade7759.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
index 68405046dae3..1691760339da 100644
--- a/drivers/staging/iio/meter/ade7759.c
+++ b/drivers/staging/iio/meter/ade7759.c
@@ -317,11 +317,11 @@ static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
 		ade7759_read_16bit,
 		ade7759_write_16bit,
 		ADE7759_APGAIN);
-static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(1, 0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_CH1OS);
-static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_CH_OFF(2, 0644,
 		ade7759_read_8bit,
 		ade7759_write_8bit,
 		ADE7759_CH2OS);
-- 
2.11.0

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

* Re: [PATCH v4 1/1] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR)
  2017-04-09 15:21       ` [PATCH v4 1/1] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR) Chen Guanqiao
@ 2017-04-14 14:04         ` Jonathan Cameron
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2017-04-14 14:04 UTC (permalink / raw)
  To: Chen Guanqiao, pmeerw; +Cc: Michael.Hennerich, linux-iio

On 09/04/17 16:21, Chen Guanqiao wrote:
> This fixes the coding style issue of using (S_IWUSR | S_IRUGO) in place of
> 4-digit octal numbers.
> 
> Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
Applied.

Thanks,

Jonathan
> ---
>  drivers/staging/iio/meter/ade7759.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
> index 68405046dae3..1691760339da 100644
> --- a/drivers/staging/iio/meter/ade7759.c
> +++ b/drivers/staging/iio/meter/ade7759.c
> @@ -317,11 +317,11 @@ static IIO_DEV_ATTR_ACTIVE_POWER_GAIN(0644,
>  		ade7759_read_16bit,
>  		ade7759_write_16bit,
>  		ADE7759_APGAIN);
> -static IIO_DEV_ATTR_CH_OFF(1, S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CH_OFF(1, 0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_CH1OS);
> -static IIO_DEV_ATTR_CH_OFF(2, S_IWUSR | S_IRUGO,
> +static IIO_DEV_ATTR_CH_OFF(2, 0644,
>  		ade7759_read_8bit,
>  		ade7759_write_8bit,
>  		ADE7759_CH2OS);
> 


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

end of thread, other threads:[~2017-04-14 14:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04  2:13 [PATCH v2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO) Chen Guanqiao
2017-04-08 17:01 ` Jonathan Cameron
2017-04-09  4:30 ` [PATCH v3 0/2] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
2017-04-09  4:30   ` [PATCH v3 1/2] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR, S_IXUGO) Chen Guanqiao
2017-04-09  8:18     ` Jonathan Cameron
2017-04-09  4:30   ` [PATCH v3 2/2] iio:meter:ade7759: realign the rest with opening bracket Chen Guanqiao
2017-04-09  8:26     ` Jonathan Cameron
2017-04-09 15:20     ` [PATCH v4 0/1] iio:meter:ade7759: use 4-digit octal permissions Chen Guanqiao
2017-04-09 15:21       ` [PATCH v4 1/1] iio:meter:ade7759: Removing use of deprecated macros (S_IRUGO, S_IWUSR) Chen Guanqiao
2017-04-14 14:04         ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.