linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: iio: adc: Add comments to prevent checks corrections
@ 2018-10-15 21:25 Gabriel Capella
  2018-10-16 12:44 ` Dan Carpenter
  2018-10-16 18:06 ` Slawomir Stepien
  0 siblings, 2 replies; 4+ messages in thread
From: Gabriel Capella @ 2018-10-15 21:25 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: linux-iio, devel, linux-kernel, kernel-usp

This patch adds 3 comments in 2 different files.
These comments warn to don't correct the checks of type:
"CHECK: spaces preferred around that '-'"

Signed-off-by: Gabriel Capella <gabriel@capella.pro>
---
 drivers/staging/iio/adc/ad7192.c  | 1 +
 drivers/staging/iio/adc/ad7280a.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index acdbc07fd259..786ace19c240 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -354,6 +354,7 @@ ad7192_show_scale_available(struct device *dev,
 	return len;
 }
 
+/* Do not put spaces around the hyphen. #checkpatch.pl */
 static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
 			     in_voltage-voltage_scale_available,
 			     0444, ad7192_show_scale_available, NULL, 0);
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 58420dcb406d..4927116a046c 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -749,6 +749,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
 	return IRQ_HANDLED;
 }
 
+/* Do not put spaces around the hyphen. #checkpatch.pl */
 static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
 		in_voltage-voltage_thresh_low_value,
 		0644,
@@ -756,6 +757,7 @@ static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
 		ad7280_write_channel_config,
 		AD7280A_CELL_UNDERVOLTAGE);
 
+/* Do not put spaces around the hyphen. #checkpatch.pl */
 static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
 		in_voltage-voltage_thresh_high_value,
 		0644,
--

 

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

* Re: [PATCH] staging: iio: adc: Add comments to prevent checks corrections
  2018-10-15 21:25 [PATCH] staging: iio: adc: Add comments to prevent checks corrections Gabriel Capella
@ 2018-10-16 12:44 ` Dan Carpenter
  2018-10-16 18:06 ` Slawomir Stepien
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-10-16 12:44 UTC (permalink / raw)
  To: Gabriel Capella
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel, kernel-usp

On Mon, Oct 15, 2018 at 06:25:21PM -0300, Gabriel Capella wrote:
> This patch adds 3 comments in 2 different files.
> These comments warn to don't correct the checks of type:
> "CHECK: spaces preferred around that '-'"
> 
> Signed-off-by: Gabriel Capella <gabriel@capella.pro>
> ---
>  drivers/staging/iio/adc/ad7192.c  | 1 +
>  drivers/staging/iio/adc/ad7280a.c | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
> index acdbc07fd259..786ace19c240 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -354,6 +354,7 @@ ad7192_show_scale_available(struct device *dev,
>  	return len;
>  }
>  
> +/* Do not put spaces around the hyphen. #checkpatch.pl */
>  static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
>  			     in_voltage-voltage_scale_available,
>  			     0444, ad7192_show_scale_available, NULL, 0);

No one will read that...  :(  It has to be on the same line.

regards,
dan carpenter


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

* Re: [PATCH] staging: iio: adc: Add comments to prevent checks corrections
  2018-10-15 21:25 [PATCH] staging: iio: adc: Add comments to prevent checks corrections Gabriel Capella
  2018-10-16 12:44 ` Dan Carpenter
@ 2018-10-16 18:06 ` Slawomir Stepien
  2018-10-16 18:16   ` Joe Perches
  1 sibling, 1 reply; 4+ messages in thread
From: Slawomir Stepien @ 2018-10-16 18:06 UTC (permalink / raw)
  To: Gabriel Capella
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel, kernel-usp, apw, joe

On paź 15, 2018 18:25, Gabriel Capella wrote:
> This patch adds 3 comments in 2 different files.
> These comments warn to don't correct the checks of type:
> "CHECK: spaces preferred around that '-'"
> 
> Signed-off-by: Gabriel Capella <gabriel@capella.pro>
> ---
>  drivers/staging/iio/adc/ad7192.c  | 1 +
>  drivers/staging/iio/adc/ad7280a.c | 2 ++
>  2 files changed, 3 insertions(+)

I have this simpler solution...let's focus our efforts on moving the two drivers
out of staging. This will prevent the CHK to appear:

Cut from checkpatch.pl:

if ($realfile =~ m@^(?:drivers/net/|net/|drivers/staging/)@) {
	$check = 1;

Existing driver out of staging, with this "problem":
$ ./scripts/checkpatch.pl --types SPACING --file drivers/iio/adc/ad7793.c        
total: 0 errors, 0 warnings, 827 lines checked

drivers/iio/adc/ad7793.c has no obvious style problems and is ready for submission.

NOTE: Used message types: SPACING

In my opinion it would stop this incorrect patches.

I have also this changes to checkpatch.pl:
https://github.com/s-stepien/linux-1/commit/c976a31b392393fb417f2d9e2ec9639bc226ad0b
and usage:
https://github.com/s-stepien/linux-1/commit/1adc0428b496f44f6a931637084bb619ddd9992d
but I'm not that sure it is the best way to go.

What do you all think?

-- 
Slawomir Stepien

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

* Re: [PATCH] staging: iio: adc: Add comments to prevent checks corrections
  2018-10-16 18:06 ` Slawomir Stepien
@ 2018-10-16 18:16   ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2018-10-16 18:16 UTC (permalink / raw)
  To: Slawomir Stepien, Gabriel Capella
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel, kernel-usp, apw

On Tue, 2018-10-16 at 20:06 +0200, Slawomir Stepien wrote:
> On paź 15, 2018 18:25, Gabriel Capella wrote:
> > This patch adds 3 comments in 2 different files.
> > These comments warn to don't correct the checks of type:
> > "CHECK: spaces preferred around that '-'"
> > 
> > Signed-off-by: Gabriel Capella <gabriel@capella.pro>
> > ---
> >  drivers/staging/iio/adc/ad7192.c  | 1 +
> >  drivers/staging/iio/adc/ad7280a.c | 2 ++
> >  2 files changed, 3 insertions(+)
> 
> I have this simpler solution...let's focus our efforts on moving the two drivers
> out of staging. This will prevent the CHK to appear:
> 
> Cut from checkpatch.pl:
> 
> if ($realfile =~ m@^(?:drivers/net/|net/|drivers/staging/)@) {
> 	$check = 1;
> 
> Existing driver out of staging, with this "problem":
> $ ./scripts/checkpatch.pl --types SPACING --file drivers/iio/adc/ad7793.c        
> total: 0 errors, 0 warnings, 827 lines checked
> 
> drivers/iio/adc/ad7793.c has no obvious style problems and is ready for submission.
> 
> NOTE: Used message types: SPACING
> 
> In my opinion it would stop this incorrect patches. -
> 
> I have also this changes to checkpatch.pl:
> https://github.com/s-stepien/linux-1/commit/c976a31b392393fb417f2d9e2ec9639bc226ad0b
> and usage:
> https://github.com/s-stepien/linux-1/commit/1adc0428b496f44f6a931637084bb619ddd9992d
> but I'm not that sure it is the best way to go.
> 
> What do you all think?

I think the suggested form is somewhat cryptic

	/* checkpatch-<foo> */

and the new checkpatch code is somewhat balky.

It also allows only a single type to ignore per line.



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

end of thread, other threads:[~2018-10-16 18:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-15 21:25 [PATCH] staging: iio: adc: Add comments to prevent checks corrections Gabriel Capella
2018-10-16 12:44 ` Dan Carpenter
2018-10-16 18:06 ` Slawomir Stepien
2018-10-16 18:16   ` Joe Perches

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).