[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7cfa578d-7981-1035-a48b-b9e6823c150f@infradead.org>
Date: Tue, 11 Jan 2022 23:36:50 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Luis Chamberlain <mcgrof@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Borislav Petkov <bp@...e.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>,
Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH] firmware_loader: simplfy builtin or module check
On 1/11/22 23:03, Randy Dunlap wrote:
>
>
> On 1/11/22 22:56, Masahiro Yamada wrote:
>> On Wed, Jan 12, 2022 at 3:37 PM Randy Dunlap <rdunlap@...radead.org> wrote:
>>>
>>>
>>>
>>> On 1/11/22 18:34, Luis Chamberlain wrote:
>>>> The existing check is outdated and confuses developers. Use the
>>>> already existing IS_ENABLED() defined on kconfig.h which makes
>>>> the intention much clearer.
>>>>
>>>> Reported-by: Borislav Petkov <bp@...en8.de>
>>>> Reported-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>>>> Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
>>>
>>> Acked-by: Randy Dunlap <rdunlap@...radead.org>
>>>
>>> Thanks.
>>>
>>>> ---
>>>> include/linux/firmware.h | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/include/linux/firmware.h b/include/linux/firmware.h
>>>> index 3b057dfc8284..fa3493dbe84a 100644
>>>> --- a/include/linux/firmware.h
>>>> +++ b/include/linux/firmware.h
>>>> @@ -34,7 +34,7 @@ static inline bool firmware_request_builtin(struct firmware *fw,
>>>> }
>>>> #endif
>>>>
>>>> -#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
>>>
>>> The "defined(MODULE)" part wasn't needed here. :)
>>
>>
>>
>> It _is_ needed.
>>
>> This seems to be equivalent to IS_REACHABLE(CONFIG_FW_LOADER),
>> not IS_ENABLE(CONFIG_FW_LOADER).>>
>
> Hm, /me confused.
>
> How can CONFIG_FW_LOADER_MODULE be =y when MODULE is not defined?
>
OK, I get it now. Thanks for correcting me.
>>
>>
>>>
>>>> +#if IS_ENABLED(CONFIG_FW_LOADER)
>>>> int request_firmware(const struct firmware **fw, const char *name,
>>>> struct device *device);
>>>> int firmware_request_nowarn(const struct firmware **fw, const char *name,
>>>
>>> --
>>> ~Randy
>>
>>
>>
>
--
~Randy
Powered by blists - more mailing lists