Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sasha Finkelstein" <k@chaosmail.tech>
Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v10 1/2] usb: typec: tipd: Factor out i2c specifics
Date: Fri, 04 Dec 2026 10:54:48 +0000	[thread overview]
Message-ID: <sashiko-outbox-249641@kernel.org> (raw)
In-Reply-To: <20261204-tipd-ace3-v10-1-1b85a2c8501d@chaosmail.tech>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] usb: typec: tipd: tipd_hw_variants array lacks const qualifier
--

commit dd5921f15fa519b31f574ee3ecf5be5499540a34
Author: Alyssa Milburn <amilburn@zall.org>

usb: typec: tipd: Factor out i2c specifics

This commit splits the I2C bus glue out of the TPS6598x core driver into
a separate i2c.c module and exports the core probe, remove, PM, and
variant lookup interfaces for other bus drivers.

> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> index 3b739f50c922f..69e0f1f9b496c 100644
> --- a/drivers/usb/typec/tipd/core.c
> +++ b/drivers/usb/typec/tipd/core.c

[ ... ]

> @@ -2116,33 +1981,14 @@ static const struct tipd_data tps25750_data = {

[ ... ]

> +const struct tipd_data *tipd_hw_variants[] = {
> +	[TIPD_VARIANT_CD321X] = &tipd_cd321x_data,
> +	[TIPD_VARIANT_TPS6598X] = &tipd_tps6598x_data,
> +	[TIPD_VARIANT_TPS66993] = &tipd_tps66993_data,
> +	[TIPD_VARIANT_TPS25750] = &tipd_tps25750_data,
>  };
> -module_i2c_driver(tps6598x_i2c_driver);
> +EXPORT_SYMBOL_GPL(tipd_hw_variants);

[Severity: Low]
Should tipd_hw_variants[] (and its extern declaration in
drivers/usb/typec/tipd/tps6598x.h) be declared as const struct tipd_data
*const tipd_hw_variants[TIPD_VARIANT_MAX]?

Without the second const qualifier, the exported pointer array referencing
the struct tipd_data ops tables is placed in writable .data instead of
.rodata, and giving it the explicit TIPD_VARIANT_MAX bound matches the
range check in tps6598x_probe_i2c().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-tipd-ace3-v10-0-1b85a2c8501d@chaosmail.tech?part=1

  reply	other threads:[~2026-12-04 10:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 10:33 [PATCH v10 0/2] usb: typec: tipd: Add sn201202x (ACE3) support Sasha Finkelstein
2026-12-04 10:33 ` [PATCH v10 1/2] usb: typec: tipd: Factor out i2c specifics Sasha Finkelstein
2026-12-04 10:54   ` sashiko-bot [this message]
2026-12-04 10:33 ` [PATCH v10 2/2] usb: typec: tipd: Add sn201202x support Sasha Finkelstein

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-249641@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=k@chaosmail.tech \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox