diff mbox

[integrity:next-restore-kexec,5/9] include/linux/ima.h:30:48: warning: 'struct kimage' declared inside parameter list

Message ID 1947465.9AqSTXMJDC@hactar (mailing list archive)
State New, archived
Headers show

Commit Message

Thiago Jung Bauermann Aug. 23, 2016, 4:42 p.m. UTC
Am Dienstag, 23 August 2016, 21:52:00 schrieb kbuild test robot:
> tree:  
> https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
> next-restore-kexec head:   62bc4b565254de4796a0835f6f67569eb4835f9f
> commit: 4733b1cd5da19fc80df1c1a91f1b1f2a94e70938 [5/9] ima: on soft
> reboot, save the measurement list config: xtensa-allmodconfig (attached
> as .config)
> compiler: xtensa-linux-gcc (GCC) 4.9.0
> reproduce:
>         wget
> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin
> /make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
>         git checkout 4733b1cd5da19fc80df1c1a91f1b1f2a94e70938
>         # save the attached .config to linux build tree
>         make.cross ARCH=xtensa
> 
> All warnings (new ones prefixed by >>):
> 
>    In file included from security/integrity/ima/ima_main.c:26:0:
> >> include/linux/ima.h:30:48: warning: 'struct kimage' declared inside
> >> parameter list
>     static inline void ima_add_kexec_buffer(struct kimage *image)
>                                                    ^
> 
> >> include/linux/ima.h:30:48: warning: its scope is only this definition
> >> or declaration, which is probably not what you want

This happens when CONFIG_IMA=y and CONFIG_KEXEC=n. You can fix it with the 
following change in the patch "ima: on soft reboot, save the measurement list":
    
    Declare stub struct kimage when CONFIG_IMA_KEXEC=n.
diff mbox

Patch

diff --git a/include/linux/ima.h b/include/linux/ima.h
index 6a2450ca13f1..412793233677 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -27,6 +27,8 @@  extern void ima_post_path_mknod(struct dentry *dentry);
 #ifdef CONFIG_IMA_KEXEC
 extern void ima_add_kexec_buffer(struct kimage *image);
 #else
+struct kimage;
+
 static inline void ima_add_kexec_buffer(struct kimage *image)
 {
 }