lkml.org 
[lkml]   [2023]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [v2] nvme: keyring: fix conditional compilation
On Wed, Oct 25, 2023, at 09:02, Hannes Reinecke wrote:
> On 10/20/23 22:54, Arnd Bergmann wrote:
oid)
>> +
>> +static inline key_serial_t nvme_target_keyring_id(void)
>> {
>> + if (IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS))
>> + return nvme_keyring_id();
>> +
>> return 0;
>> }
>> -static inline int nvme_keyring_init(void)
>> +
>> +static inline int nvme_target_keyring_init(void)
>> {
>> + if (IS_ENABLED(CONFIG_NVME_TCP_TLS))
>> + return nvme_keyring_init();
>> +
>> return 0;
>> }
>> -static inline void nvme_keyring_exit(void) {}
>>
>> -#endif /* !CONFIG_NVME_KEYRING */
>> +static inline void nvme_target_keyring_exit(void)
>> +{
>> + if (IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS))
>> + nvme_keyring_exit();
>> +}
>> +
>> #endif /* _NVME_KEYRING_H */
>
> I guess the right way is to make 'keyring' a 'real' module, and move
> 'nvme_keyring_init()' and 'nvme_keyring_exit()' as the modules init/exit
> functions. I'll prepare a patch.

That's probably a good idea, but you still need to address
the link failure for nvme_keyring_id() and nvme_tls_psk_default()
when the caller is built-in and the definition is in a loadable
module.

Arnd

\
 
 \ /
  Last update: 2023-10-25 09:47    [W:1.412 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site