Linux IIO development
 help / color / mirror / Atom feed
From: "Maxwell Doose" <maxwell@maxwelld.cc>
To: "Jonathan Cameron" <jonathan.cameron@oss.qualcomm.com>,
	<linux-iio@vger.kernel.org>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>
Subject: Re: [PATCH 04/22] iio: chemical: scd30: Remove redundant i2c_master_{send,recv}() length checks
Date: Thu, 16 Jul 2026 10:30:43 -0500	[thread overview]
Message-ID: <DK03QB4665XF.3RK4MG7Y9V9PR@maxwelld.cc> (raw)
In-Reply-To: <20260716005737.254577-5-jonathan.cameron@oss.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

On Wed Jul 15, 2026 at 7:57 PM CDT
Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> wrote:

> i2c_master_send() and i2c_master_recv() return either a negative errno
> or exactly the count passed in, so a length check after the 'ret < 0'
> test can never be true. Drop the dead branches.
>
> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
> Assisted-by: Claude:claude-opus-4-8
> ---
>  drivers/iio/chemical/scd30_i2c.c | 4 ----
>  1 file changed, 4 deletions(-)
>

I'm not 100% sure that's the case but since the i2c docs aren't very
helpful on this I will probably pester the i2c maintainers about this.

-- 
best regards,
max

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2026-07-16 15:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16  0:57 [RESEND PATCH 00/22] IIO: Clean out superfluous I2C checks for single transfers Jonathan Cameron
2026-07-16  0:57 ` [PATCH 01/22] iio: adc: ltc2471: Remove redundant i2c_master_recv() length check Jonathan Cameron
2026-07-16  0:57 ` [PATCH 02/22] iio: adc: ti-ads7138: Remove redundant i2c_master_send() length checks Jonathan Cameron
2026-07-16  0:57 ` [PATCH 03/22] iio: adc: versal-sysmon: Remove redundant i2c_master_{send,recv}() " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 04/22] iio: chemical: scd30: " Jonathan Cameron
2026-07-16 15:30   ` Maxwell Doose [this message]
2026-07-16  0:57 ` [PATCH 05/22] iio: chemical: scd4x: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 06/22] iio: chemical: sgp30: Remove redundant i2c_master_recv() length check Jonathan Cameron
2026-07-16  0:57 ` [PATCH 07/22] iio: chemical: sgp40: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 08/22] iio: chemical: sps30: Remove redundant i2c_master_{send,recv}() length checks Jonathan Cameron
2026-07-16  0:57 ` [PATCH 09/22] iio: dac: ad5446: Remove redundant i2c_master_send() length check Jonathan Cameron
2026-07-16  0:57 ` [PATCH 10/22] iio: dac: ad5696: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 11/22] iio: dac: m62332: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 12/22] iio: dac: max517: " Jonathan Cameron
2026-07-16  7:45   ` Joshua Crofts
2026-07-16  0:57 ` [PATCH 13/22] iio: dac: max5821: Remove redundant i2c_master_{send,recv}() length checks Jonathan Cameron
2026-07-16  0:57 ` [PATCH 14/22] iio: dac: mcp4725: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 15/22] iio: dac: mcp4728: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 16/22] iio: light: lv0104cs: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 17/22] iio: potentiometer: ad5110: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 18/22] iio: pressure: abp2030pa: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 19/22] iio: pressure: adp810: " Jonathan Cameron
2026-07-16  0:57 ` [PATCH 20/22] iio: pressure: icp10100: Remove redundant i2c_master_send() length check Jonathan Cameron
2026-07-16  0:57 ` [PATCH 21/22] iio: pressure: mprls0025pa: Remove redundant i2c_master_{send,recv}() length checks Jonathan Cameron
2026-07-16  0:57 ` [PATCH 22/22] iio: pressure: sdp500: Remove redundant i2c_master_recv() length check Jonathan Cameron
2026-07-16  8:01 ` [RESEND PATCH 00/22] IIO: Clean out superfluous I2C checks for single transfers Joshua Crofts
2026-07-16 10:15 ` Nuno Sá
2026-07-16 14:55 ` Lars-Peter Clausen

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=DK03QB4665XF.3RK4MG7Y9V9PR@maxwelld.cc \
    --to=maxwell@maxwelld.cc \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jonathan.cameron@oss.qualcomm.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox