From: "Leo L. Schwab" <ewhac@ewhac.org>
To: Hans de Goede <hansg@kernel.org>
Cc: Kate Hsuan <hpa@redhat.com>, Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] HID: lg-g15 - Add support for Logitech G13.
Date: Sun, 31 Aug 2025 12:51:16 -0700 [thread overview]
Message-ID: <aLSntMknSv3lMarZ@ewhac.org> (raw)
In-Reply-To: <7d356834-5795-4979-9f51-0ffcec52ae1d@kernel.org>
On Sun, Aug 31, 2025 at 03:01:12PM +0200, Hans de Goede wrote:
> > +static const u16 g13_keys_for_bits_js[] = {
> > + /* Joystick buttons */
> > + /* These keybits are at bit indices 33, 34, and 35. */
> > + BTN_BASE, /* Left side */
> > + BTN_BASE2, /* Bottom side */
> > + BTN_THUMB, /* Stick depress */
> > +};
>
> You are using this 33 offset hardcoded below, maybe
> at a #define for this, e.g. :
>
> #define G13_JS_KEYBITS_OFFSET 33
>
Noted.
> g13_keys_for_bits_js[] is contiguous so no need
> for this if (g13_keys_for_bits_js[i]) test.
>
Noted.
> > + if (IS_ENABLED(CONFIG_LEDS_BRIGHTNESS_HW_CHANGED)) {
>
> I do not believe that this IS_ENABLED(CONFIG_LEDS_BRIGHTNESS_HW_CHANGED)
> is necessary, led_classdev_notify_brightness_hw_changed() has a static
> inline replacement when CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set,
> so you can just call it unconditionally.
>
> This is already called unconditionally in other places of the code.
>
I was actually bit by this in the first two revs by the build bot.
If CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not enabled, the field
`cdev.brightness_hw_changed`, referenced a bit further down, does not exist,
and causes a build failure.
My first attempt at #ifdef-ing around it led to another build bot
warning about `hw_brightness_changed` being defined but not used. Then I
leanred about `IS_ENABLED()`, which is evidently now preferred over `#ifdef
CONFIG_`, and nicely isolated the whole block, so I went with that.
> g13_keys_for_bits_js[] is contiguous so no need
> for this if (g13_keys_for_bits_js[i]) test.
>
> This will also allow you to drop the {} from the for loop.
>
Noted.
I've been mucking around with Rust a bit lately (and badly indented
JavaScript rather more), and am now in the habit putting braces around
single-line `if` clauses.
> Besides from my few small remarks this looks good to me,
> feel free to add:
>
> Reviewed-by: Hans de Goede <hansg@kernel.org>
>
> to the next version.
>
Thank you very kindly, sir!
Schwab
next prev parent reply other threads:[~2025-08-31 20:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 21:26 Leo L. Schwab
2025-08-31 13:01 ` Hans de Goede
2025-08-31 19:51 ` Leo L. Schwab [this message]
2025-09-02 9:07 ` Hans de Goede
2025-09-02 9:14 ` Hans de Goede
2025-09-02 20:41 ` Leo L. Schwab
2025-09-02 21:05 ` Hans de Goede
2025-09-03 19:39 ` Leo L. Schwab
2025-09-08 21:08 ` Hans de Goede
2025-09-10 5:52 ` Leo L. Schwab
2025-09-10 11:09 ` Hans de Goede
2025-09-10 18:02 ` Leo L. Schwab
2025-09-10 19:16 ` Hans de Goede
2025-09-15 22:18 ` Leo L. Schwab
2025-09-17 10:33 ` Hans de Goede
2025-09-17 19:50 ` Leo L. Schwab
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=aLSntMknSv3lMarZ@ewhac.org \
--to=ewhac@ewhac.org \
--cc=bentiss@kernel.org \
--cc=hansg@kernel.org \
--cc=hpa@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®