All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>, arnd@arndb.de
Cc: Pavel Machek <pavel@ucw.cz>, Andrew Lunn <andrew@lunn.ch>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>
Subject: Re: [PATCH] leds: Change devm_led_classdev_register_ext stub logic to use IS_REACHABLE
Date: Tue, 9 Jan 2024 08:37:39 +0000	[thread overview]
Message-ID: <20240109083739.GE7948@google.com> (raw)
In-Reply-To: <0f6f432b-c650-4bb8-a1b5-fe3372804d52@gmail.com>

On Thu, 28 Dec 2023, Heiner Kallweit wrote:

> If CONFIG_LEDS_CLASS = m and the caller of devm_led_classdev_register
> is built-in, we get a compile/link error.
> To avoid this we could add conditional compiling to the caller, but
> exactly this overhead we wanted to avoid with adding the stubs.
> Easiest solution is to use the existing stub also in case IS_ENABLED
> is true, but IS_REACHABLE is false.
> 
> Fixes: 18764b883e15 ("r8169: add support for LED's on RTL8168/RTL8101")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202312281159.9TPeXbNd-lkp@intel.com/
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  include/linux/leds.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Arnd pretty much NACKed this, right?

https://lore.kernel.org/r/b310230b-f20b-489a-97ed-908df193a942@app.fastmail.com

> diff --git a/include/linux/leds.h b/include/linux/leds.h
> index 4754b02d3..1eecee316 100644
> --- a/include/linux/leds.h
> +++ b/include/linux/leds.h
> @@ -279,7 +279,7 @@ static inline int led_classdev_register(struct device *parent,
>  	return led_classdev_register_ext(parent, led_cdev, NULL);
>  }
>  
> -#if IS_ENABLED(CONFIG_LEDS_CLASS)
> +#if IS_REACHABLE(CONFIG_LEDS_CLASS)
>  int devm_led_classdev_register_ext(struct device *parent,
>  					  struct led_classdev *led_cdev,
>  					  struct led_init_data *init_data);
> -- 
> 2.43.0
> 

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2024-01-09  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28  8:55 [PATCH] leds: Change devm_led_classdev_register_ext stub logic to use IS_REACHABLE Heiner Kallweit
2024-01-09  8:37 ` Lee Jones [this message]
2024-01-09  9:04   ` Arnd Bergmann

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=20240109083739.GE7948@google.com \
    --to=lee@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=hkallweit1@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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.