From: sashiko-bot@kernel.org
To: "Denis Benato" <denis.benato@linux.dev>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v13 05/18] HID: asus: add joysticks inner and outer range configuration
Date: Wed, 04 Nov 2026 01:53:52 +0000 [thread overview]
Message-ID: <sashiko-outbox-196411@kernel.org> (raw)
In-Reply-To: <20261104013935.512713-6-denis.benato@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] HID: asus: ally_prefs_setup() mixes scoped_guard() with goto error handling
--
commit 23b7fd753beca8abc912e5e22d7a6deed94442a0
Author: Denis Benato <denis.benato@linux.dev>
HID: asus: add joysticks inner and outer range configuration
This commit adds sysfs attributes for configuring the inner and outer
joystick thresholds on ASUS ROG Ally devices and restores those threshold
settings on device initialization.
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 459061391c378..a89ce83ae93f4 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
[ ... ]
> @@ -1182,15 +1401,44 @@ static int ally_prefs_setup(struct hid_device *hdev, struct ally_intf *intf)
> }
> }
>
> + scoped_guard(mutex, &ally_prefs.lock)
> + cal_live = ally_prefs.user_cal_support ||
> + ally_prefs.anti_deadzone_support ||
> + ally_prefs.resp_curve_support;
> +
> + /* Skip the calibration groups when the capability is missing. */
> + if (cal_live) {
> + for (; cal_n < ARRAY_SIZE(ally_cal_attr_groups); cal_n++) {
> + ret = sysfs_create_group(&hdev->dev.kobj,
> + ally_cal_attr_groups[cal_n]);
> + if (ret) {
> + hid_err(hdev, "Failed to create Ally sysfs group '%s': %d\n",
> + ally_cal_attr_groups[cal_n]->name, ret);
> + goto err_cal_groups;
> + }
> + }
> + }
> +
> scoped_guard(mutex, &ally_prefs.lock) {
> + intf->cal_sysfs_live = cal_live;
> intf->sysfs_live = true;
> }
>
> return 0;
> +
> +err_cal_groups:
> + while (cal_n--)
> + sysfs_remove_group(&hdev->dev.kobj, ally_cal_attr_groups[cal_n]);
> +
> + for (i = 0; i < ARRAY_SIZE(ally_attr_groups); i++)
> + sysfs_remove_group(&hdev->dev.kobj, &ally_attr_groups[i]);
> +
> + return ret;
> }
[Severity: Low]
This isn't a bug, but ally_prefs_setup() uses scoped_guard() while also
introducing a goto err_cal_groups error path when sysfs_create_group()
fails for ally_cal_attr_groups.
Since the cleanup API guidelines discourage mixing scope-based cleanup
helpers with goto-based error handling in the same function, could the
unwinding be done inline (similar to the earlier ally_attr_groups loop in
ally_prefs_setup()), or by using sysfs_create_groups() and
sysfs_remove_groups() with a NULL-terminated array to avoid the goto label?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104013935.512713-1-denis.benato@linux.dev?part=5
next prev parent reply other threads:[~2026-11-04 1:53 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 1:39 [PATCH v13 00/18] HID: asus: add support for ROG Ally handhelds Denis Benato
2026-11-04 1:39 ` [PATCH v13 01/18] HID: asus: size feature reports from the HID report descriptor Denis Benato
2026-11-04 1:39 ` [PATCH v13 02/18] HID: asus: add support for ROG Ally handhelds Denis Benato
2026-11-04 2:07 ` sashiko-bot
2026-11-04 1:39 ` [PATCH v13 03/18] HID: asus: add gamepad configuration Denis Benato
2026-11-04 1:59 ` sashiko-bot
2026-11-04 1:39 ` [PATCH v13 04/18] HID: asus: add vibration strength configuration Denis Benato
2026-11-04 1:39 ` [PATCH v13 05/18] HID: asus: add joysticks inner and outer range configuration Denis Benato
2026-11-04 1:53 ` sashiko-bot [this message]
2026-11-04 1:39 ` [PATCH v13 06/18] HID: asus: add triggers " Denis Benato
2026-11-04 1:39 ` [PATCH v13 07/18] HID: asus: add joysticks anti-deadzone configuration Denis Benato
2026-11-04 1:39 ` [PATCH v13 08/18] HID: asus: add support for response curve Denis Benato
2026-11-04 1:39 ` [PATCH v13 09/18] HID: asus: add support to force feedback Denis Benato
2026-11-04 1:39 ` [PATCH v13 10/18] HID: asus: add support for gamepad mode Denis Benato
2026-11-04 1:39 ` [PATCH v13 11/18] HID: asus: add support for turbo buttons Denis Benato
2026-11-04 1:52 ` sashiko-bot
2026-11-04 1:39 ` [PATCH v13 12/18] HID: asus: add support for btn remapping Denis Benato
2026-11-04 1:58 ` sashiko-bot
2026-11-04 1:39 ` [PATCH v13 13/18] HID: asus: identify XG Mobile stations and bind the LED to the reported model Denis Benato
2026-11-04 1:39 ` [PATCH v13 14/18] HID: asus: expose XG Mobile identity and firmware information Denis Benato
2026-11-04 1:39 ` [PATCH v13 15/18] HID: asus: document ROG XG Mobile sysfs attributes Denis Benato
2026-11-04 1:39 ` [PATCH v13 16/18] HID: asus: document ROG Ally " Denis Benato
2026-11-04 1:55 ` sashiko-bot
2026-11-04 1:39 ` [PATCH v13 17/18] platform/x86: asus-armoury: pick the eGPU activation from the reported GPU Denis Benato
2026-11-04 1:39 ` [PATCH v13 18/18] MAINTAINERS: add maintainer for the ASUS HID driver Denis Benato
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-196411@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=denis.benato@linux.dev \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.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