All of lore.kernel.org
 help / color / mirror / Atom feed
From: Waqar Hameed <waqar.hameed@axis.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	<linux-kernel@vger.kernel.org>, <linux-iio@vger.kernel.org>,
	<kernel@axis.com>
Subject: Re: [PATCH 2/2] iio: Add driver for Murata IRS-D200
Date: Wed, 12 Jul 2023 17:33:09 +0200	[thread overview]
Message-ID: <pndcz0xkuka.fsf@axis.com> (raw)
In-Reply-To: <20230625120604.3ecc54bf@jic23-huawei>

On Sun, Jun 25, 2023 at 12:06 +0100 Jonathan Cameron <jic23@kernel.org> wrote:

[...]

>> >> +		dev_err(data->dev, "Could not write hp filter frequency (%d)\n",
>> >> +			ret);
>> >> +		return ret;  
>> >
>> > drop this return ret out of the if block here.
>> >
>> > In general being able to ignore possibility of ret > 0 simplifies handling.  
>> 
>> I try to be consistent and it also "helps" the next person potentially
>> adding code after the `if`-statement and forgetting about adding
>> `return`. We can drop the `return here, but then we should do the same
>> in other places with a check just before the last `return` (like
>> `irsd200_write_timer()`, `irsd200_read_nr_count()`,
>> `irsd200_write_nr_count()` and many more), right?
>
> I don't feel particulartly strongly about this, but there are scripts
> that get used to scan for this pattern to simplify the code.
>
> Sure on the other cases. I don't tend to try and label all cases of things
> pointed out, just pick on one and rely on the patch author to generalise.

I started to remove the returns but then realized that it got a little
messy. For example, in some cases we can't drop the return (side effects
after the return etc.). 

Since you didn't have any strong opinions on this, I kept them in v2.
Hope that's fine!

  parent reply	other threads:[~2023-07-12 15:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 15:10 [PATCH 0/2] Add driver for Murata IRS-D200 Waqar Hameed
2023-06-16 15:10 ` [PATCH 1/2] dt-bindings: iio: proximity: Add bindings " Waqar Hameed
2023-06-17  8:55   ` Krzysztof Kozlowski
2023-06-19 10:40     ` Waqar Hameed
2023-06-19 11:29       ` Krzysztof Kozlowski
2023-06-17 12:55   ` Jonathan Cameron
2023-06-19 10:41     ` Waqar Hameed
2023-07-02 10:34       ` Jonathan Cameron
2023-06-16 15:10 ` [PATCH 2/2] iio: Add driver " Waqar Hameed
2023-06-17  1:37   ` Lars-Peter Clausen
2023-06-19 11:21     ` Waqar Hameed
2023-06-17 13:35   ` Jonathan Cameron
2023-06-19 11:24     ` Waqar Hameed
2023-06-25 11:06       ` Jonathan Cameron
2023-06-30  8:54         ` Waqar Hameed
2023-07-02 10:42           ` Jonathan Cameron
2023-07-03  8:59             ` Waqar Hameed
2023-07-05  7:50               ` Jonathan Cameron
2023-07-12 15:33         ` Waqar Hameed [this message]
2023-07-15 16:51           ` Jonathan Cameron

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=pndcz0xkuka.fsf@axis.com \
    --to=waqar.hameed@axis.com \
    --cc=jic23@kernel.org \
    --cc=kernel@axis.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.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 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.