linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Slawomir Stepien <sst@poczta.fm>, <linux-iio@vger.kernel.org>,
	<devel@driverdev.osuosl.org>, <Michael.Hennerich@analog.com>,
	<gregkh@linuxfoundation.org>, <pmeerw@pmeerw.net>,
	<knaack.h@gmx.de>, <jic23@kernel.org>
Subject: Re: [PATCH] staging: iio: adc: add missing spaces around minus sign
Date: Mon, 1 Oct 2018 14:54:52 +0100	[thread overview]
Message-ID: <20181001145452.0000111f@huawei.com> (raw)
In-Reply-To: <20181001133533.mkp6qxpuo3yb4m6b@mwanda>

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

      reply	other threads:[~2018-10-01 20:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181001145452.0000111f@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=sst@poczta.fm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).