From: sashiko-bot@kernel.org
To: "Oleg Keri" <okerixx@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v3 2/3] platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver
Date: Mon, 21 Sep 2026 15:00:03 +0000 [thread overview]
Message-ID: <20260921150004.0EC3D1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260921144953.15113-3-okerixx@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] hwmon: platform EC driver registers hwmon directly instead of using aux device
- [Medium] i2c: device ID name exceeds I2C_NAME_SIZE causing truncation
--
commit a7a9ebb5757758e9760736e7550c333cea597cae
Author: Oleg Keri <okerixx@gmail.com>
platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver
This commit adds an embedded controller driver for the Lenovo Yoga Slim
7x Gen 11 laptop. The driver provides thermistors, battery cell voltages,
and CPU fan speed as hwmon channels, alongside keyboard backlight and
hotkey controls.
> diff --git a/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c b/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c
> --- /dev/null
> +++ b/drivers/platform/arm64/lenovo-yoga-slim7x-gen11-ec.c
[ ... ]
> +static int yoga_ec_probe(struct i2c_client *client)
> +{
[ ... ]
> + hwmon = devm_hwmon_device_register_with_info(dev, "yoga_slim7x_ec", ec,
> + &yoga_ec_chip_info, NULL);
[Severity: Medium]
Does this code violate the hwmon subsystem guidelines?
The EC driver acts as a platform multi-function device providing hwmon,
input, and LED capabilities, but registers hwmon directly from
drivers/platform/arm64/ inside yoga_ec_probe().
According to the hwmon subsystem guidelines, the hardware monitoring
functionality of a platform multi-function device should be implemented
as an auxiliary device driver residing in drivers/hwmon/ to avoid layering
violations and bypass of maintainer review.
[ ... ]
> +static const struct i2c_device_id yoga_ec_i2c_id[] = {
> + { "yoga-slim7x-gen11-ec" },
> + { }
> +};
[Severity: Medium]
Can this device ID string cause truncation and matching failures?
The string "yoga-slim7x-gen11-ec" is exactly 20 characters long. Since
I2C_NAME_SIZE is 20, the string literal fully occupies the array without
a null terminator.
During module build, modpost might read past the array generating garbage
for modules.alias. At runtime, the client's name populated from device tree
or ACPI will be truncated to 19 characters plus a null terminator. This
causes i2c_match_id() to fail because it will compare the truncated
runtime string against the unterminated string literal.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921144953.15113-1-okerixx@gmail.com?part=2
next prev parent reply other threads:[~2026-09-21 15:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 14:49 [PATCH v3 0/3] platform/arm64: Lenovo Yoga Slim 7x Gen 11 embedded controller Oleg Keri
2026-09-21 14:49 ` [PATCH v3 1/3] dt-bindings: embedded-controller: add Lenovo Yoga Slim 7x Gen 11 EC Oleg Keri
2026-09-21 14:54 ` sashiko-bot
2026-09-21 14:49 ` [PATCH v3 2/3] platform/arm64: add Lenovo Yoga Slim 7x Gen 11 EC driver Oleg Keri
2026-09-21 15:00 ` sashiko-bot [this message]
2026-09-21 15:20 ` Ilpo Järvinen
2026-09-21 15:52 ` Oleg Keri
2026-09-21 14:49 ` [PATCH v3 3/3] arm64: dts: qcom: glymur-lenovo-yoga-slim7x: add the embedded controller Oleg Keri
2026-09-21 14:55 ` sashiko-bot
2026-09-22 12:03 ` Konrad Dybcio
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=20260921150004.0EC3D1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=okerixx@gmail.com \
--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