* [PATCH] staging: iio: adc: add missing spaces around minus sign
@ 2018-10-01 12:28 Slawomir Stepien
2018-10-01 12:51 ` Peter Meerwald-Stadler
2018-10-01 12:52 ` Dan Carpenter
0 siblings, 2 replies; 7+ messages in thread
From: Slawomir Stepien @ 2018-10-01 12:28 UTC (permalink / raw)
To: linux-iio; +Cc: lars, Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, devel
The checkpatch.pl tool detected coding style problem:
CHECK: spaces preferred around that '-' (ctx:VxV)
in two files inside the adc directory. This patch will remove this
problem.
Signed-off-by: Slawomir Stepien <sst@poczta.fm>
---
drivers/staging/iio/adc/ad7192.c | 2 +-
drivers/staging/iio/adc/ad7280a.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index acdbc07fd259..7c632cf1932b 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -355,7 +355,7 @@ ad7192_show_scale_available(struct device *dev,
}
static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
- in_voltage-voltage_scale_available,
+ in_voltage - voltage_scale_available,
0444, ad7192_show_scale_available, NULL, 0);
static IIO_DEVICE_ATTR(in_voltage_scale_available, 0444,
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 58420dcb406d..a4b4f8678c56 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -750,14 +750,14 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
}
static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
- in_voltage-voltage_thresh_low_value,
+ in_voltage - voltage_thresh_low_value,
0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_CELL_UNDERVOLTAGE);
static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
- in_voltage-voltage_thresh_high_value,
+ in_voltage - voltage_thresh_high_value,
0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
--
2.19.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: iio: adc: add missing spaces around minus sign
2018-10-01 12:28 [PATCH] staging: iio: adc: add missing spaces around minus sign Slawomir Stepien
@ 2018-10-01 12:51 ` Peter Meerwald-Stadler
2018-10-01 13:02 ` Slawomir Stepien
2018-10-01 12:52 ` Dan Carpenter
1 sibling, 1 reply; 7+ messages in thread
From: Peter Meerwald-Stadler @ 2018-10-01 12:51 UTC (permalink / raw)
To: Slawomir Stepien; +Cc: linux-iio, lars, jic23, gregkh, devel
> The checkpatch.pl tool detected coding style problem:
>
> CHECK: spaces preferred around that '-' (ctx:VxV)
oh no, not again
please see e.g. https://lore.kernel.org/patchwork/patch/635994/
for some discussion why this patch doesn't make sense
> in two files inside the adc directory. This patch will remove this
> problem.
>
> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
> ---
> drivers/staging/iio/adc/ad7192.c | 2 +-
> drivers/staging/iio/adc/ad7280a.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
> index acdbc07fd259..7c632cf1932b 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -355,7 +355,7 @@ ad7192_show_scale_available(struct device *dev,
> }
>
> static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
> - in_voltage-voltage_scale_available,
> + in_voltage - voltage_scale_available,
> 0444, ad7192_show_scale_available, NULL, 0);
>
> static IIO_DEVICE_ATTR(in_voltage_scale_available, 0444,
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 58420dcb406d..a4b4f8678c56 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -750,14 +750,14 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
> }
>
> static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
> - in_voltage-voltage_thresh_low_value,
> + in_voltage - voltage_thresh_low_value,
> 0644,
> ad7280_read_channel_config,
> ad7280_write_channel_config,
> AD7280A_CELL_UNDERVOLTAGE);
>
> static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
> - in_voltage-voltage_thresh_high_value,
> + in_voltage - voltage_thresh_high_value,
> 0644,
> ad7280_read_channel_config,
> ad7280_write_channel_config,
>
--
Peter Meerwald-Stadler
Mobile: +43 664 24 44 418
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: iio: adc: add missing spaces around minus sign
2018-10-01 12:28 [PATCH] staging: iio: adc: add missing spaces around minus sign Slawomir Stepien
2018-10-01 12:51 ` Peter Meerwald-Stadler
@ 2018-10-01 12:52 ` Dan Carpenter
2018-10-01 12:54 ` Lars-Peter Clausen
1 sibling, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2018-10-01 12:52 UTC (permalink / raw)
To: Slawomir Stepien
Cc: linux-iio, devel, lars, Michael.Hennerich, gregkh, pmeerw,
knaack.h, jic23
On Mon, Oct 01, 2018 at 02:28:34PM +0200, Slawomir Stepien wrote:
> The checkpatch.pl tool detected coding style problem:
>
> CHECK: spaces preferred around that '-' (ctx:VxV)
>
> in two files inside the adc directory. This patch will remove this
> problem.
>
> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
> ---
> drivers/staging/iio/adc/ad7192.c | 2 +-
> drivers/staging/iio/adc/ad7280a.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
> index acdbc07fd259..7c632cf1932b 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -355,7 +355,7 @@ ad7192_show_scale_available(struct device *dev,
> }
>
> static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
> - in_voltage-voltage_scale_available,
> + in_voltage - voltage_scale_available,
> 0444, ad7192_show_scale_available, NULL, 0);
This doesn't work. That's not arithmatic, it's a string which is passed
to a macro. It's an ugly macro, but it would take a lot of work to
change it at this point.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: iio: adc: add missing spaces around minus sign
2018-10-01 12:52 ` Dan Carpenter
@ 2018-10-01 12:54 ` Lars-Peter Clausen
2018-10-01 13:35 ` Dan Carpenter
0 siblings, 1 reply; 7+ messages in thread
From: Lars-Peter Clausen @ 2018-10-01 12:54 UTC (permalink / raw)
To: Dan Carpenter, Slawomir Stepien
Cc: linux-iio, devel, Michael.Hennerich, gregkh, pmeerw, knaack.h,
jic23
On 10/01/2018 02:52 PM, Dan Carpenter wrote:
> On Mon, Oct 01, 2018 at 02:28:34PM +0200, Slawomir Stepien wrote:
>> The checkpatch.pl tool detected coding style problem:
>>
>> CHECK: spaces preferred around that '-' (ctx:VxV)
>>
>> in two files inside the adc directory. This patch will remove this
>> problem.
>>
>> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
>> ---
>> drivers/staging/iio/adc/ad7192.c | 2 +-
>> drivers/staging/iio/adc/ad7280a.c | 4 ++--
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
>> index acdbc07fd259..7c632cf1932b 100644
>> --- a/drivers/staging/iio/adc/ad7192.c
>> +++ b/drivers/staging/iio/adc/ad7192.c
>> @@ -355,7 +355,7 @@ ad7192_show_scale_available(struct device *dev,
>> }
>>
>> static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
>> - in_voltage-voltage_scale_available,
>> + in_voltage - voltage_scale_available,
>> 0444, ad7192_show_scale_available, NULL, 0);
>
>
> This doesn't work. That's not arithmatic, it's a string which is passed
> to a macro. It's an ugly macro, but it would take a lot of work to
> change it at this point.
>From a technical perspective it is easy to change this. We already had
patches for that. The difficulty is convincing Greg that this would be a
sensible change to pass the string as a string and not a preprocessor token.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: iio: adc: add missing spaces around minus sign
2018-10-01 12:51 ` Peter Meerwald-Stadler
@ 2018-10-01 13:02 ` Slawomir Stepien
0 siblings, 0 replies; 7+ messages in thread
From: Slawomir Stepien @ 2018-10-01 13:02 UTC (permalink / raw)
To: Peter Meerwald-Stadler; +Cc: linux-iio, lars, jic23, gregkh, devel
On paź 01, 2018 14:51, Peter Meerwald-Stadler wrote:
>
> > The checkpatch.pl tool detected coding style problem:
> >
> > CHECK: spaces preferred around that '-' (ctx:VxV)
>
> oh no, not again
> please see e.g. https://lore.kernel.org/patchwork/patch/635994/
> for some discussion why this patch doesn't make sense
Oh...my mistake. Thank you for clarification. I should be more careful. Sorry!
> > in two files inside the adc directory. This patch will remove this
> > problem.
> >
> > Signed-off-by: Slawomir Stepien <sst@poczta.fm>
> > ---
> > drivers/staging/iio/adc/ad7192.c | 2 +-
> > drivers/staging/iio/adc/ad7280a.c | 4 ++--
> > 2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
> > index acdbc07fd259..7c632cf1932b 100644
> > --- a/drivers/staging/iio/adc/ad7192.c
> > +++ b/drivers/staging/iio/adc/ad7192.c
> > @@ -355,7 +355,7 @@ ad7192_show_scale_available(struct device *dev,
> > }
> >
>
> > static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
> > - in_voltage-voltage_scale_available,
> > + in_voltage - voltage_scale_available,
> > 0444, ad7192_show_scale_available, NULL, 0);
> >
> > static IIO_DEVICE_ATTR(in_voltage_scale_available, 0444,
> > diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> > index 58420dcb406d..a4b4f8678c56 100644
> > --- a/drivers/staging/iio/adc/ad7280a.c
> > +++ b/drivers/staging/iio/adc/ad7280a.c
> > @@ -750,14 +750,14 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
> > }
> >
> > static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
> > - in_voltage-voltage_thresh_low_value,
> > + in_voltage - voltage_thresh_low_value,
> > 0644,
> > ad7280_read_channel_config,
> > ad7280_write_channel_config,
> > AD7280A_CELL_UNDERVOLTAGE);
> >
> > static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
> > - in_voltage-voltage_thresh_high_value,
> > + in_voltage - voltage_thresh_high_value,
> > 0644,
> > ad7280_read_channel_config,
> > ad7280_write_channel_config,
> >
>
--
Slawomir Stepien
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: iio: adc: add missing spaces around minus sign
2018-10-01 12:54 ` Lars-Peter Clausen
@ 2018-10-01 13:35 ` Dan Carpenter
2018-10-01 13:54 ` Jonathan Cameron
0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2018-10-01 13:35 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: Slawomir Stepien, linux-iio, devel, Michael.Hennerich, gregkh,
pmeerw, knaack.h, jic23
On Mon, Oct 01, 2018 at 02:54:55PM +0200, Lars-Peter Clausen wrote:
> On 10/01/2018 02:52 PM, Dan Carpenter wrote:
> > On Mon, Oct 01, 2018 at 02:28:34PM +0200, Slawomir Stepien wrote:
> >> The checkpatch.pl tool detected coding style problem:
> >>
> >> CHECK: spaces preferred around that '-' (ctx:VxV)
> >>
> >> in two files inside the adc directory. This patch will remove this
> >> problem.
> >>
> >> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
> >> ---
> >> drivers/staging/iio/adc/ad7192.c | 2 +-
> >> drivers/staging/iio/adc/ad7280a.c | 4 ++--
> >> 2 files changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
> >> index acdbc07fd259..7c632cf1932b 100644
> >> --- a/drivers/staging/iio/adc/ad7192.c
> >> +++ b/drivers/staging/iio/adc/ad7192.c
> >> @@ -355,7 +355,7 @@ ad7192_show_scale_available(struct device *dev,
> >> }
> >>
> >> static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
> >> - in_voltage-voltage_scale_available,
> >> + in_voltage - voltage_scale_available,
> >> 0444, ad7192_show_scale_available, NULL, 0);
> >
> >
> > This doesn't work. That's not arithmatic, it's a string which is passed
> > to a macro. It's an ugly macro, but it would take a lot of work to
> > change it at this point.
>
> >From a technical perspective it is easy to change this. We already had
> patches for that. The difficulty is convincing Greg that this would be a
> sensible change to pass the string as a string and not a preprocessor token.
Oh. Hm... I was looking at this wrong. It would be awkward to make it
a string because the _show() op names depend on the filename.
People do keep bumping into this mistake, but there is no chance that
anyone is going to merge it so it's probably not worth investing any
more time on it.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] staging: iio: adc: add missing spaces around minus sign
2018-10-01 13:35 ` Dan Carpenter
@ 2018-10-01 13:54 ` Jonathan Cameron
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2018-10-01 13:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Lars-Peter Clausen, Slawomir Stepien, linux-iio, devel,
Michael.Hennerich, gregkh, pmeerw, knaack.h, jic23
On Mon, 1 Oct 2018 16:35:33 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Mon, Oct 01, 2018 at 02:54:55PM +0200, Lars-Peter Clausen wrote:
> > On 10/01/2018 02:52 PM, Dan Carpenter wrote:
> > > On Mon, Oct 01, 2018 at 02:28:34PM +0200, Slawomir Stepien wrote:
> > >> The checkpatch.pl tool detected coding style problem:
> > >>
> > >> CHECK: spaces preferred around that '-' (ctx:VxV)
> > >>
> > >> in two files inside the adc directory. This patch will remove this
> > >> problem.
> > >>
> > >> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
> > >> ---
> > >> drivers/staging/iio/adc/ad7192.c | 2 +-
> > >> drivers/staging/iio/adc/ad7280a.c | 4 ++--
> > >> 2 files changed, 3 insertions(+), 3 deletions(-)
> > >>
> > >> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
> > >> index acdbc07fd259..7c632cf1932b 100644
> > >> --- a/drivers/staging/iio/adc/ad7192.c
> > >> +++ b/drivers/staging/iio/adc/ad7192.c
> > >> @@ -355,7 +355,7 @@ ad7192_show_scale_available(struct device *dev,
> > >> }
> > >>
> > >> static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
> > >> - in_voltage-voltage_scale_available,
> > >> + in_voltage - voltage_scale_available,
> > >> 0444, ad7192_show_scale_available, NULL, 0);
> > >
> > >
> > > This doesn't work. That's not arithmatic, it's a string which is passed
> > > to a macro. It's an ugly macro, but it would take a lot of work to
> > > change it at this point.
> >
> > >From a technical perspective it is easy to change this. We already had
> > patches for that. The difficulty is convincing Greg that this would be a
> > sensible change to pass the string as a string and not a preprocessor token.
>
> Oh. Hm... I was looking at this wrong. It would be awkward to make it
> a string because the _show() op names depend on the filename.
>
> People do keep bumping into this mistake, but there is no chance that
> anyone is going to merge it so it's probably not worth investing any
> more time on it.
>
Or... Plan b) use the callbacks to generate this automatically and avoid
having to have the macro use at all.
In theory it was on the plan to get rid of all of these _available definitions
in favour of ones that in kernel consumers can actually read easily, we just
haven't made that much progress with it.
Jonathan
p.s. Good learning experience for people to discover that checkpatch isn't
infallible? *ducks*
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-10-01 20:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-01 12:28 [PATCH] staging: iio: adc: add missing spaces around minus sign Slawomir Stepien
2018-10-01 12:51 ` Peter Meerwald-Stadler
2018-10-01 13:02 ` Slawomir Stepien
2018-10-01 12:52 ` Dan Carpenter
2018-10-01 12:54 ` Lars-Peter Clausen
2018-10-01 13:35 ` Dan Carpenter
2018-10-01 13:54 ` Jonathan Cameron
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).