From: Coiby Xu Date: Wed, 25 Feb 2026 06:03:45 +0000 (+0800) Subject: crash: align the declaration of crash_load_dm_crypt_keys with CONFIG_CRASH_DM_CRYPT X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe74eb289163d10b34f8ee571cdc3257306f343f;p=thirdparty%2Fkernel%2Flinux.git crash: align the declaration of crash_load_dm_crypt_keys with CONFIG_CRASH_DM_CRYPT This will prevent a compilation failure when CONFIG_CRASH_DUMP is enabled but CONFIG_CRASH_DM_CRYPT is disabled, arch/powerpc/kexec/elf_64.c: In function 'elf64_load': >> arch/powerpc/kexec/elf_64.c:82:23: error: implicit declaration of function 'crash_load_dm_crypt_keys' [-Werror=implicit-function-declaration] 82 | ret = crash_load_dm_crypt_keys(image); | ^~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors Link: https://lkml.kernel.org/r/20260225060347.718905-3-coxu@redhat.com Signed-off-by: Coiby Xu Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202602120648.RgQALnnI-lkp@intel.com/ Acked-by: Baoquan He Cc: Arnaud Lefebvre Cc: Christophe Leroy (CS GROUP) Cc: Dave Young Cc: Kairui Song Cc: Krzysztof Kozlowski Cc: Pingfan Liu Cc: Rob Herring Cc: Sourabh Jain Cc: Thomas Staudt Cc: Will Deacon Signed-off-by: Andrew Morton --- diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h index d35726d6a415..c1dee3f971a9 100644 --- a/include/linux/crash_core.h +++ b/include/linux/crash_core.h @@ -34,13 +34,6 @@ static inline void arch_kexec_protect_crashkres(void) { } static inline void arch_kexec_unprotect_crashkres(void) { } #endif -#ifdef CONFIG_CRASH_DM_CRYPT -int crash_load_dm_crypt_keys(struct kimage *image); -ssize_t dm_crypt_keys_read(char *buf, size_t count, u64 *ppos); -#else -static inline int crash_load_dm_crypt_keys(struct kimage *image) {return 0; } -#endif - #ifndef arch_crash_handle_hotplug_event static inline void arch_crash_handle_hotplug_event(struct kimage *image, void *arg) { } #endif @@ -96,4 +89,11 @@ static inline void crash_save_cpu(struct pt_regs *regs, int cpu) {}; static inline int kimage_crash_copy_vmcoreinfo(struct kimage *image) { return 0; }; #endif /* CONFIG_CRASH_DUMP*/ +#ifdef CONFIG_CRASH_DM_CRYPT +int crash_load_dm_crypt_keys(struct kimage *image); +ssize_t dm_crypt_keys_read(char *buf, size_t count, u64 *ppos); +#else +static inline int crash_load_dm_crypt_keys(struct kimage *image) {return 0; } +#endif + #endif /* LINUX_CRASH_CORE_H */