public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Mudit Sharma <muditsharma.info@gmail.com>
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	ivan.orlov0322@gmail.com, lars@metafoo.de, krzk+dt@kernel.org,
	conor+dt@kernel.org, robh@kernel.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/3] iio: light: ROHM BH1745 colour sensor
Date: Sat, 8 Jun 2024 16:20:35 +0100	[thread overview]
Message-ID: <20240608162035.6965cad5@jic23-huawei> (raw)
In-Reply-To: <14ac1188-a018-4ebb-bf64-7818fab9ab7b@gmail.com>


> >>>
> >>> Nit: black line before return (it applies to several functions in this
> >>> driver, but again, not in all of them).  
> >>
> >> Hi Javier,
> >>
> >> Thank you for the review on this.
> >>
> >> Can you please point me to resource/section of code style guide for
> >> reference which talks about new line before 'return'.
> >>
> >> Best regards,
> >> Mudit Sharma
> >>
> >>
> >>  
> > 
> > AFAIK that is not written in stone, but many common practices are not
> > documented anywhere (e.g. names of error/ret variables). They just copy
> > what the majority of the code in that subsystem does. There is indeed a
> > tendency to add a blank line before the last (unconditional, not
> > labeled) return, but I am sure that some code does not follow that.
> > 
> > Having said that, I don't have a strong opinion (it was a nitpick) on
> > that, but what I would definitely recommend you is following **some**
> > pattern. There are some functions where you added a blank line, and some
> > others (the majority, I think), where you didn't. Given that this is new
> > code, uniformity would be appreciated.
> > 
> > Unless an IIO maintainer (I am NOT one) says otherwise, I would find
> > both approaches (blank/no line) reasonable, even though I like the blank
> > line in that particular case :)
> > 
> > Best regards,
> > Javier Carrasco  
> 
> Thanks for the explanation here.
> 
> I agree with having a consistent pattern and will make the necessary 
> changes to v3.
> 
> Best regards,
> Mudit Sharma
> 
I'm feeling grumpy today and you are the unlucky ones, given it's
been a day of much scrolling.

Crop your replies to just the relevant context as I've done here.

Yes, I prefer the blank line in most cases. However as noted the more
important factor is local consistency.  Aim here is to make your code
as easy to review as possible - having it all look the same is a good
way to help that.

Jonathan
 


  reply	other threads:[~2024-06-08 15:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 16:21 [PATCH v2 1/3] dt-bindings: iio: light: ROHM BH1745 Mudit Sharma
2024-06-03 16:21 ` [PATCH v2 2/3] iio: light: ROHM BH1745 colour sensor Mudit Sharma
2024-06-03 16:49   ` Ivan Orlov
2024-06-03 23:10   ` Javier Carrasco
2024-06-04 14:24     ` Mudit Sharma
2024-06-04 14:58       ` Javier Carrasco
2024-06-04 15:49         ` Mudit Sharma
2024-06-08 15:20           ` Jonathan Cameron [this message]
2024-06-05  7:51   ` kernel test robot
2024-06-03 16:21 ` [PATCH v2 3/3] MAINTAINERS: Add maintainer for ROHM BH1745 Mudit Sharma
2024-06-03 16:47   ` Ivan Orlov
2024-06-03 22:37   ` Javier Carrasco
2024-06-04 10:44     ` Mudit Sharma
2024-06-04 12:53       ` Javier Carrasco
2024-06-04 13:38         ` Matti Vaittinen
2024-06-04 13:47           ` Javier Carrasco
2024-06-04  6:35 ` [PATCH v2 1/3] dt-bindings: iio: light: " Krzysztof Kozlowski

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=20240608162035.6965cad5@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ivan.orlov0322@gmail.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muditsharma.info@gmail.com \
    --cc=robh@kernel.org \
    /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