From: sashiko-bot@kernel.org
To: "Vicki Pfau" <vi@endrift.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH v6 3/3] HID: nintendo: Add unified report format support
Date: Thu, 25 Jun 2026 05:13:34 +0000 [thread overview]
Message-ID: <20260625051335.6F41E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260625045948.2343168-4-vi@endrift.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Global minimum report size check incorrectly rejects valid legacy, non-unified reports.
--
commit ebbc8f2a738bc80390ec8c8785093f44578537e8
Author: Vicki Pfau <vi@endrift.com>
HID: nintendo: Add unified report format support
This commit adds support for the unified report format that all controllers
also support. It includes overlapping fields for like buttons and axes between
them.
> diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
> index ae360f4d15d1a..9cb4a503fe2d3 100644
> --- a/drivers/hid/hid-nintendo.c
> +++ b/drivers/hid/hid-nintendo.c
[ ... ]
> @@ -3732,7 +3833,7 @@ static int switch2_event(struct hid_device *hdev, struct hid_report *report, uin
> if (report->type != HID_INPUT_REPORT)
> return 0;
>
> - if (size < 15)
> + if (size < 17)
> return -EINVAL;
>
[Severity: High]
Does this global size check incorrectly reject valid non-unified reports?
Since non-unified reports like NS2_REPORT_GC only access up to raw_data[14]
and can legitimately have a size of exactly 15 bytes, it seems this check will
cause those legitimate 15-byte or 16-byte reports to be dropped with -EINVAL
in switch2_event().
Should this 17-byte requirement be scoped inside the case NS2_REPORT_UNIFIED:
block instead?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260625045948.2343168-1-vi@endrift.com?part=3
prev parent reply other threads:[~2026-06-25 5:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 4:59 [PATCH v6 0/3] HID: nintendo: Add preliminary Switch 2 controller driver Vicki Pfau
2026-06-25 4:59 ` [PATCH v6 1/3] " Vicki Pfau
2026-06-25 5:16 ` sashiko-bot
2026-06-25 4:59 ` [PATCH v6 2/3] HID: nintendo: Add rumble support for Switch 2 controllers Vicki Pfau
2026-06-25 5:18 ` sashiko-bot
2026-06-25 4:59 ` [PATCH v6 3/3] HID: nintendo: Add unified report format support Vicki Pfau
2026-06-25 5:13 ` sashiko-bot [this message]
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=20260625051335.6F41E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vi@endrift.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