All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jonathan McDowell <noodles@fb.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Mimi Zohar <zohar@linux.ibm.com>, Baoquan He <bhe@redhat.com>
Subject: [daveh-devel:testme 2/2] drivers/of/kexec.c:126:5: warning: no previous prototype for function 'ima_get_kexec_buffer'
Date: Sun, 12 Jun 2022 03:48:56 +0800	[thread overview]
Message-ID: <202206120314.1cOFS37U-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git testme
head:   a217a1ebac788fd28ccf79499e9e12e5519d70b7
commit: a217a1ebac788fd28ccf79499e9e12e5519d70b7 [2/2] x86/kexec: Carry forward IMA measurement log on kexec
config: x86_64-randconfig-a001 (https://download.01.org/0day-ci/archive/20220612/202206120314.1cOFS37U-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ff4abe755279a3a47cc416ef80dbc900d9a98a19)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git/commit/?id=a217a1ebac788fd28ccf79499e9e12e5519d70b7
        git remote add daveh-devel https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git
        git fetch --no-tags daveh-devel testme
        git checkout a217a1ebac788fd28ccf79499e9e12e5519d70b7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/of/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/of/kexec.c:126:5: warning: no previous prototype for function 'ima_get_kexec_buffer' [-Wmissing-prototypes]
   int ima_get_kexec_buffer(void **addr, size_t *size)
       ^
   drivers/of/kexec.c:126:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int ima_get_kexec_buffer(void **addr, size_t *size)
   ^
   static 
>> drivers/of/kexec.c:153:5: warning: no previous prototype for function 'ima_free_kexec_buffer' [-Wmissing-prototypes]
   int ima_free_kexec_buffer(void)
       ^
   drivers/of/kexec.c:153:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int ima_free_kexec_buffer(void)
   ^
   static 
   2 warnings generated.


vim +/ima_get_kexec_buffer +126 drivers/of/kexec.c

fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  118  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  119  /**
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  120   * ima_get_kexec_buffer - get IMA buffer from the previous kernel
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  121   * @addr:	On successful return, set to point to the buffer contents.
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  122   * @size:	On successful return, set to the buffer size.
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  123   *
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  124   * Return: 0 on success, negative errno on error.
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  125   */
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21 @126  int ima_get_kexec_buffer(void **addr, size_t *size)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  127  {
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  128  	int ret, len;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  129  	unsigned long tmp_addr;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  130  	size_t tmp_size;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  131  	const void *prop;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  132  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  133  	if (!IS_ENABLED(CONFIG_HAVE_IMA_KEXEC))
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  134  		return -ENOTSUPP;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  135  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  136  	prop = of_get_property(of_chosen, "linux,ima-kexec-buffer", &len);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  137  	if (!prop)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  138  		return -ENOENT;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  139  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  140  	ret = do_get_kexec_buffer(prop, len, &tmp_addr, &tmp_size);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  141  	if (ret)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  142  		return ret;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  143  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  144  	*addr = __va(tmp_addr);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  145  	*size = tmp_size;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  146  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  147  	return 0;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  148  }
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  149  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  150  /**
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  151   * ima_free_kexec_buffer - free memory used by the IMA buffer
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  152   */
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21 @153  int ima_free_kexec_buffer(void)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  154  {
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  155  	int ret;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  156  	unsigned long addr;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  157  	size_t size;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  158  	struct property *prop;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  159  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  160  	if (!IS_ENABLED(CONFIG_HAVE_IMA_KEXEC))
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  161  		return -ENOTSUPP;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  162  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  163  	prop = of_find_property(of_chosen, "linux,ima-kexec-buffer", NULL);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  164  	if (!prop)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  165  		return -ENOENT;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  166  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  167  	ret = do_get_kexec_buffer(prop->value, prop->length, &addr, &size);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  168  	if (ret)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  169  		return ret;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  170  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  171  	ret = of_remove_property(of_chosen, prop);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  172  	if (ret)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  173  		return ret;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  174  
3ecc68349bbab6 Mike Rapoport           2021-11-05  175  	return memblock_phys_free(addr, size);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  176  }
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  177  

:::::: The code at line 126 was first introduced by commit
:::::: fee3ff99bc67604fba77f19da0106f3ec52b1956 powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

:::::: TO: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
:::::: CC: Rob Herring <robh@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-06-11 19:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202206120314.1cOFS37U-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bhe@redhat.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=noodles@fb.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.