All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Pengpeng Hou" <hppiscas@163.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH] HID: lg4ff: use IS_REACHABLE(CONFIG_LEDS_CLASS) for wheel LEDs
Date: Fri, 04 Dec 2026 02:37:14 +0000	[thread overview]
Message-ID: <sashiko-outbox-248990@kernel.org> (raw)
In-Reply-To: <179635115621.74470.12359277234264394358@163.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] HID: lg4ff: redundant IS_REACHABLE(CONFIG_LEDS_CLASS)
  preprocessor guards
--

commit a37dabf5bd6831438894f407db9423b32e6bd057
Author: Pengpeng Hou <hppiscas@163.com>

HID: lg4ff: use IS_REACHABLE(CONFIG_LEDS_CLASS) for wheel LEDs

This commit replaces the #ifdef CONFIG_LEDS_CLASS guards in
drivers/hid/hid-lg4ff.c with #if IS_REACHABLE(CONFIG_LEDS_CLASS) so wheel
RPM LED support is compiled when both the driver and the LED class are
modules.

> diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
> index 62f99a93210c9..d4411a696cc48 100644
> --- a/drivers/hid/hid-lg4ff.c
> +++ b/drivers/hid/hid-lg4ff.c
> @@ -67,7 +67,7 @@ struct lg4ff_wheel_data {
>  	u16 range;
>  	const u16 min_range;
>  	const u16 max_range;
> -#ifdef CONFIG_LEDS_CLASS
> +#if IS_REACHABLE(CONFIG_LEDS_CLASS)
>  	u8  led_state;
>  	struct led_classdev *led[5];
>  #endif

[Severity: Low]
Are these IS_REACHABLE(CONFIG_LEDS_CLASS) guards needed at all?

In drivers/hid/Kconfig, HID_LOGITECH unconditionally depends on
LEDS_CLASS and LOGIWHEELS_FF depends on HID_LOGITECH.  Since hid-lg4ff.o
is only linked into hid-logitech.o, CONFIG_LEDS_CLASS is always reachable
whenever hid-lg4ff.c is built.

Removing all four preprocessor guards and the extra scoping block in
lg4ff_deinit() would be simpler and avoid suggesting that LED class
support is optional.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/179635115621.74470.12359277234264394358@163.com?part=1

      reply	other threads:[~2026-12-04  2:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  2:25 [PATCH] HID: lg4ff: use IS_REACHABLE(CONFIG_LEDS_CLASS) for wheel LEDs Pengpeng Hou
2026-12-04  2:37 ` 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=sashiko-outbox-248990@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hppiscas@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.