Re: security/integrity/ima/ima_kexec.c:81:6: warning: no previous prototype for function 'ima_add_kexec_buffer'

From: nramas
Date: Wed Jun 09 2021 - 10:26:46 EST


On Wed, 2021-06-09 at 12:10 +0800, kernel test robot wrote:

Hi,

> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross
> ARCH=arm64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All warnings (new ones prefixed by >>):
>
> > > security/integrity/ima/ima_kexec.c:81:6: warning: no previous
> > > prototype for function 'ima_add_kexec_buffer' [-Wmissing-
> > > prototypes]
> void ima_add_kexec_buffer(struct kimage *image)
> ^

"linux/ima.h" needs to be included in
"security/integrity/ima/ima_kexec.c" to fix the above warning.

Thanks for reporting. I will post a patch shortly.

-lakshmi

> security/integrity/ima/ima_kexec.c:81:1: note: declare 'static' if
> the function is not intended to be used outside of this translation
> unit
> void ima_add_kexec_buffer(struct kimage *image)
> ^
> static
> 1 warning generated.