All of lore.kernel.org
 help / color / mirror / Atom feed
From: DEEPAK VARMA <mh12gx2825@gmail.com>
To: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
Cc: "julia.lawall@inria.fr" <julia.lawall@inria.fr>,
	"kieran.bingham@ideasonboard.com"
	<kieran.bingham@ideasonboard.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"Hennerich, Michael" <Michael.Hennerich@analog.com>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"knaack.h@gmx.de" <knaack.h@gmx.de>,
	"daniel.baluta@gmail.com" <daniel.baluta@gmail.com>,
	"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
	"outreachy-kernel@googlegroups.com" 
	<outreachy-kernel@googlegroups.com>
Subject: Re: [Outreachy kernel] Re: [PATCH 2/2] staging: iio: adc: ad7280a: Add spaces around operators
Date: Sat, 21 Mar 2020 15:55:23 +0530	[thread overview]
Message-ID: <20200321102522.GA3019@deeUbuntu> (raw)
In-Reply-To: <20200319161608.GA14738@deeUbuntu>

On Thu, Mar 19, 2020 at 09:46:10PM +0530, DEEPAK VARMA wrote:
> On Thu, Mar 19, 2020 at 07:07:20AM +0000, Ardelean, Alexandru wrote:
> > On Thu, 2020-03-19 at 08:03 +0100, Julia Lawall wrote:
> > > [External]
> > > 
> > > 
> > > 
> > > On Thu, 19 Mar 2020, Ardelean, Alexandru wrote:
> > > 
> > > > On Wed, 2020-03-18 at 22:30 +0530, DEEPAK VARMA wrote:
> > > > > [External]
> > > > > 
> > > > > On Wed, Mar 18, 2020 at 05:28:17PM +0100, Julia Lawall wrote:
> > > > > > On Wed, 18 Mar 2020, DEEPAK VARMA wrote:
> > > > > > 
> > > > > > > On Wed, Mar 18, 2020 at 04:19:24PM +0100, Greg KH wrote:
> > > > > > > > On Wed, Mar 18, 2020 at 04:12:28PM +0100, Lars-Peter Clausen wrote:
> > > > > > > > > On 3/18/20 7:00 AM, Greg KH wrote:
> > > > > > > > > > On Wed, Mar 18, 2020 at 09:58:13AM +0530, Deepak R Varma wrote:
> > > > > > > > > > > Add spaces around operator symbols to improve readability.
> > > > > > > > > > > Warning
> > > > > > > > > > > flagged by checkpatch script.
> > > > > > > > > > > 
> > > > > > > > > > > Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
> > > > > > > > > > > ---
> > > > > > > > > > >   drivers/staging/iio/adc/ad7280a.c | 4 ++--
> > > > > > > > > > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > > > > > > > > > 
> > > > > > > > > > > diff --git a/drivers/staging/iio/adc/ad7280a.c
> > > > > > > > > > > b/drivers/staging/iio/adc/ad7280a.c
> > > > > > > > > > > index 19a5f244dcae..34ca0d09db85 100644
> > > > > > > > > > > --- a/drivers/staging/iio/adc/ad7280a.c
> > > > > > > > > > > +++ b/drivers/staging/iio/adc/ad7280a.c
> > > > > > > > > > > @@ -825,14 +825,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,
> > > > > > > > > > 
> > > > > > > > > > Did you try building this code?
> > > > > > > > > > 
> > > > > > > > > > It catches everyone...
> > > > > > > > > 
> > > > > > > > > The problem is it builds. The token is stringyfied and
> > > > > > > > > "in_voltage - voltage_thresh_high_value" is a valid string.
> > > > > > > > 
> > > > > > > > Ah, I thought it used to break the build when it happened.  Oh well,
> > > > > > > > it's still a great "trick" to see if people understand C or not :)
> > > > > > > > 
> > > > > > > Yes, it did build. I am sorry but I am not following you fully. Can
> > > > > > > you
> > > > > > > please let me know if the change I introduced is not good. You may
> > > > > > > please direct me to a document where I can read more about it.
> > > > > > 
> > > > > > The code involves a macro, as indicated by the capital letters.  You
> > > > > > will
> > > > > > see the issue when you look at the definition of the macro.
> > > > > > 
> > > > > > julia
> > > > > 
> > > > > Thank you Julia and all. I got my mistake. I will revert the change.
> > > > > Sorry for the trouble.
> > > > 
> > > > I'll try to make some time to address this somehow, so that checkpatch
> > > > doesn't
> > > > bump into this.
> > > > 
> > > > In the last 2-3 years, I think I saw 3-4 patches trying to address this [for
> > > > various Analog drivers].
> > > > So, don't feel too bad.
> > > 
> > > Maybe a comment?
> > 
> > Comment works for now.
> > Anybody wants to do a patch for that?
> > If nobody sends a patch for this in 1-2 weeks, I'll send one.
> > 
> > Particularly, this would help with review, since people that are unfamiliar with
> > IIO-specific macros would also find it easier at review.
> > 
> > The good part, is that it's only needed for AD7280A.
> > AD7192 has been re-worked, and is no longer on checkpatch's radar.
> > I'm reworking AD7793 now.
> > 
> 
> I will be happy to add a comment around the code area to indicate
> ignore checkpatch warning for the mentioned argument. Please confirm if
> that is what you are expecting to be done.
> 

Hello Alexandru,
could you please confirm if I should add a comment around the code in
ad7280a.c to avoid further changes being made to the string argument?


> Thanks,
> Deepak.
> 
> > 
> > > 
> > > julia
> > > 
> > > > 
> > > > > Deepak.
> > > > > > > Thanks,
> > > > > > > Deepak.
> > > > > > > > thanks,
> > > > > > > > 
> > > > > > > > greg k-h
> > > > > > > 
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the Google
> > > > > > > Groups
> > > > > > > "outreachy-kernel" group.
> > > > > > > To unsubscribe from this group and stop receiving emails from it, send
> > > > > > > an
> > > > > > > email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > > > > > To view this discussion on the web visit
> > > > > > > https://groups.google.com/d/msgid/outreachy-kernel/20200318162353.GA23226%40deeUbuntu
> > > > > > > .
> > > > > > > 

  parent reply	other threads:[~2020-03-21 10:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18  4:26 [PATCH 0/2] staging: iio: adc: General code reformatting / cleanup patchset Deepak R Varma
2020-03-18  4:26 ` [PATCH 1/2] staging: iio: adc: ad7192: Reformat lines crossing 80 columns Deepak R Varma
2020-03-18  6:00   ` Greg KH
2020-03-18 15:12     ` DEEPAK VARMA
2020-03-18 15:18       ` Greg KH
2020-03-18  8:31   ` [Outreachy kernel] " Stefano Brivio
2020-03-18 16:06     ` DEEPAK VARMA
2020-03-18 16:22       ` Rohit Sarkar
2020-03-18 16:43         ` DEEPAK VARMA
2020-03-18 16:44           ` Lars-Peter Clausen
2020-03-18 17:31             ` DEEPAK VARMA
2020-03-19  7:04         ` Ardelean, Alexandru
2020-03-18  4:28 ` [PATCH 2/2] staging: iio: adc: ad7280a: Add spaces around operators Deepak R Varma
2020-03-18  6:00   ` Greg KH
2020-03-18 15:09     ` DEEPAK VARMA
2020-03-18 15:12     ` Lars-Peter Clausen
2020-03-18 15:19       ` Greg KH
2020-03-18 16:23         ` DEEPAK VARMA
2020-03-18 16:27           ` Greg KH
2020-03-18 16:28           ` [Outreachy kernel] " Julia Lawall
2020-03-18 17:00             ` DEEPAK VARMA
2020-03-19  7:00               ` Ardelean, Alexandru
2020-03-19  7:03                 ` Julia Lawall
2020-03-19  7:07                   ` Ardelean, Alexandru
2020-03-19 16:16                     ` DEEPAK VARMA
2020-03-20  7:13                       ` Ardelean, Alexandru
2020-03-21 10:25                       ` DEEPAK VARMA [this message]
2020-03-22  9:06                         ` Ardelean, Alexandru

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=20200321102522.GA3019@deeUbuntu \
    --to=mh12gx2825@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandru.Ardelean@analog.com \
    --cc=daniel.baluta@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=julia.lawall@inria.fr \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=pmeerw@pmeerw.net \
    /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 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.