[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d81a7a8b-6199-a82f-45ab-d94e9f024435@linux.intel.com>
Date: Mon, 29 Dec 2025 12:33:44 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Denis Benato <denis.benato@...ux.dev>,
Denis Benato <benato.denis96@...il.com>
cc: Krzysztof Kozlowski <krzk@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
platform-driver-x86@...r.kernel.org, Hans de Goede <hansg@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
"Luke D . Jones" <luke@...nes.dev>, Mateusz Schyboll <dragonn@...pl>
Subject: Re: [PATCH 3/3] platform/x86: asus-armoury: add keyboard control
firmware attributes
On Fri, 26 Dec 2025, Krzysztof Kozlowski wrote:
> On 26/12/2025 12:46, Denis Benato wrote:
> >
> > On 12/26/25 12:06, Krzysztof Kozlowski wrote:
> >> On 25/12/2025 15:30, Denis Benato wrote:
> >>> +ASUS_ATTR_GROUP_BOOL(kbd_leds_shutdown, "kbd_leds_shutdown",
> >>> + "Keyboard backlight while system is shutdown");
> >>> +
> >>> static ssize_t gpu_mux_mode_current_value_store(struct kobject *kobj,
> >>> struct kobj_attribute *attr,
> >>> const char *buf, size_t count)
> >>> @@ -867,6 +1043,35 @@ static bool has_valid_limit(const char *name, const struct power_limits *limits)
> >>> return limit_value > 0;
> >>> }
> >>>
> >>> +static struct asus_armoury_kbd_status *asus_init_kbd_state(void)
> >>> +{
> >>> + int err;
> >>> + u32 kbd_status;
> >>> + struct asus_armoury_kbd_status *kbd_state __free(kfree) = NULL;
> >> This is an undesired syntax explicitly documented as one to avoid. You
> >> need here proper assignment, not NULL. Please don't use cleanup.h if you
> >> do not intend to follow it because it does not make the code simpler.
> > Hello and thank you for your feedback!
> >
> > I have used __free here to match a previous comment from Ilpo:
> > https://lore.kernel.org/all/25bd0c90-2de0-ef66-c18d-661180b71fd4@linux.intel.com/
> > and I figured that since this is the same exact pattern as that it would have made
> > sense to use it.
> >
> > May I ask you to elaborate further please? If there is a more effective way to take
> > advantage of cleanup.h I will very much consider it.
>
> Just read the doc before using it. It is very, very clear what is the
> recommended syntax,
The documentation is in include/linux/cleanup.h itself (search for "NULL"
to find the relevant part towards the end of the long comment).
And please still use __free(), we just want to avoid using its
anti-patterns.
--
i.
Powered by blists - more mailing lists