From 7635873f3da210733d668acb8551e4668add9719 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Wed, 20 Dec 2023 15:09:21 +0000 Subject: [PATCH] misc: mods: Fix build when OPTEE is a module If the Linux kernel driver OPTEE is built as a module (CONFIG_OPTEE=m) then building the MODS driver for Tegra fails with the following error ... drivers/misc/mods/mods_optee.c:22:5: error: no previous prototype for 'esc_mods_invoke_optee_ta' [-Werror=missing-prototypes] 22 | int esc_mods_invoke_optee_ta(struct mods_client *client, | ^~~~~~~~~~~~~~~~~~~~~~~~ The problem is in the mods_internal.h file that wraps the prototype for the above function with '#ifdef CONFIG_OPTEE'. This works fine for when CONFIG_OPTEE=y but not if CONFIG_OPTEE=m. To ensure that this prototype is present when the OPTEE driver is built into the kernel or a module, we need to use '#if IS_ENABLED(CONFIG_OPTEE)'. Update the MODS driver accordingly to fix this. Bug 4429280 Change-Id: I48054f60cf26c04d2cacff8d8affc46254020aff Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3038965 (cherry picked from commit 0bd71e49bdefa7e8ec3f1404d2859e065f25d6a4) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055962 Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- drivers/misc/mods/mods_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mods/mods_internal.h b/drivers/misc/mods/mods_internal.h index 910e8378..aa0872a6 100644 --- a/drivers/misc/mods/mods_internal.h +++ b/drivers/misc/mods/mods_internal.h @@ -670,7 +670,7 @@ int esc_mods_send_trustzone_msg(struct mods_client *client, struct MODS_TZ_PARAMS *p); #endif -#ifdef CONFIG_OPTEE +#if IS_ENABLED(CONFIG_OPTEE) /* OP-TEE TA call */ int esc_mods_invoke_optee_ta(struct mods_client *client, struct MODS_OPTEE_PARAMS *p);