All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Anastasia Belova <abelova@astralinux.ru>,
	Tomasz Duszynski <tomasz.duszynski@octakon.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	lvc-project@linuxtesting.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>
Subject: Re: [lvc-project] [PATCH] iio: chemical: scd30: Add check for NULL in scd30_i2c_command
Date: Fri, 13 Jan 2023 22:27:44 +0300	[thread overview]
Message-ID: <15a05909-a373-09af-c0bf-1b35fd019bd5@ispras.ru> (raw)
In-Reply-To: <CAHp75Vf3SZEFmXoqm8-ynyYq5p8Eme93Da87RbCP5-9hzAzrZg@mail.gmail.com>

On 13.01.2023 21:47, Andy Shevchenko wrote:
> On Fri, Jan 13, 2023 at 8:41 PM Alexey Khoroshilov
> <khoroshilov@ispras.ru> wrote:
>> On 13.01.2023 16:33, Anastasia Belova wrote:
> 
>> It seems it is better to put the whole validation loop under if (rsp)
>> check.
> 
> No. The entire patch is redundant.
> The code that calls this function is under the control of the same
> driver, so we know how to avoid shooting in our foot.

I see, there is an assumption that response is NULL iff size is zero.

May be it could be documented, because naming of arguments does not make
such assumption obvious for fresh readers.

--
Thank you,
Alexey

  reply	other threads:[~2023-01-13 19:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 13:33 [PATCH] iio: chemical: scd30: Add check for NULL in scd30_i2c_command Anastasia Belova
2023-01-13 14:03 ` Andy Shevchenko
2023-01-13 18:41 ` [lvc-project] " Alexey Khoroshilov
2023-01-13 18:47   ` Andy Shevchenko
2023-01-13 19:27     ` Alexey Khoroshilov [this message]
2023-01-13 21:00       ` Andy Shevchenko

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=15a05909-a373-09af-c0bf-1b35fd019bd5@ispras.ru \
    --to=khoroshilov@ispras.ru \
    --cc=abelova@astralinux.ru \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=tomasz.duszynski@octakon.com \
    /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.