+#ifdef CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+extern void ima_post_key_create_or_update(struct key *keyring,
+ struct key *key,
+ unsigned long flags, bool create);
+#endif
The extern void ima_post_key_create_or_update will only be defined if CONFIG_IMA=y.
This will cause a compile error if CONFIG_IMA is not defined and CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y.
security/keys/key.c: In function 'key_create_or_update':
security/keys/key.c:940:2: error: implicit declaration of function 'ima_post_key_create_or_update'; did you mean 'key_create_or_update'? [-Werror=implicit-function-declaration]
ima_post_key_create_or_update(keyring, key, flags, true);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
key_create_or_update
cc1: some warnings being treated as errors