All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/bridge: ite-it66121: improve reading IDs and log on errors
Date: Thu, 15 Oct 2026 09:57:51 +0000	[thread overview]
Message-ID: <sashiko-outbox-172614@kernel.org> (raw)
In-Reply-To: <20261015-drm-ite-it66121-log-probe-errors-v1-1-7fd6994e0be0@bootlin.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] drm: Sparse warnings due to __u16 usage for little-endian data
--

commit 8f50576e49682d9068991d3e7de12fc063b0685f
Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
drm/bridge: ite-it66121: improve reading IDs and log on errors

This commit switches from individual regmap_read() calls to a single
regmap_bulk_read() when fetching vendor and device IDs. It introduces a
union to explicitly handle the data bytes and adds proper error checking
to prevent silently continuing with invalid values.

> diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
> --- a/drivers/gpu/drm/bridge/ite-it66121.c
> +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> @@ -1579,7 +1579,16 @@ static const struct it66121_chip_info it66xx_chip_info[] = {
>  
>  static int it66121_probe(struct i2c_client *client)
>  {
> -	u32 revision_id, vendor_ids[2] = { 0 }, device_ids[2] = { 0 };
> +	union {
> +		__u8 byte[4];
> +		struct {
> +			__u16 vendor;
> +			__u16 device;
> +		};

[Severity: Low]
Should these fields be declared as __le16 instead of __u16?

Since they hold little-endian data populated directly by regmap_bulk_read()
and are later passed to le16_to_cpu(), using natively-typed __u16 here
violates the kernel's endianness typing rules and triggers Sparse warnings
for incorrect types.

> +	} chip_id_regs;
> +	BUILD_BUG_ON(sizeof(chip_id_regs) != 4);
> +	u16 vendor_id, device_id;

[ ... ]

> @@ -1643,19 +1652,22 @@ static int it66121_probe(struct i2c_client *client)

[ ... ]

> +	vendor_id = le16_to_cpu(chip_id_regs.vendor);
> +	device_id = le16_to_cpu(chip_id_regs.device);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261015-drm-ite-it66121-log-probe-errors-v1-0-7fd6994e0be0@bootlin.com?part=1

  reply	other threads:[~2026-10-15  9:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  9:48 [PATCH 0/3] drm/bridge: ite-it66121: use bulk read, improve probe logging Luca Ceresoli
2026-10-15  9:48 ` [PATCH 1/3] drm/bridge: ite-it66121: improve reading IDs and log on errors Luca Ceresoli
2026-10-15  9:57   ` sashiko-bot [this message]
2026-10-15 10:47   ` Javier Martinez Canillas
2026-10-15 11:40     ` Luca Ceresoli
2026-10-15 12:05       ` Javier Martinez Canillas
2026-10-15  9:48 ` [PATCH 2/3] drm/bridge: ite-it66121: log an error if the IDs do not match Luca Ceresoli
2026-10-15 10:48   ` Javier Martinez Canillas
2026-10-15  9:48 ` [PATCH 3/3] drm/bridge: ite-it66121: make successful probe quiet Luca Ceresoli
2026-10-15 10:48   ` Javier Martinez Canillas
2026-10-15 10:49     ` Javier Martinez Canillas

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=sashiko-outbox-172614@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.