All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [mark:arm64/alternatives/info 1/1] arch/arm64/kernel/alternative.c:147:6: warning: no previous prototype for 'summarize_alternatives'
Date: Wed, 22 Feb 2023 18:20:19 +0800	[thread overview]
Message-ID: <202302221852.fPvgpgS6-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/alternatives/info
head:   840fba2983086adad6957d08ff7c0a36c39560e7
commit: 840fba2983086adad6957d08ff7c0a36c39560e7 [1/1] HACK: arm64: alternatives: dump summary of alternatives
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20230222/202302221852.fPvgpgS6-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 12.1.0
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/mark/linux.git/commit/?id=840fba2983086adad6957d08ff7c0a36c39560e7
        git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
        git fetch --no-tags mark arm64/alternatives/info
        git checkout 840fba2983086adad6957d08ff7c0a36c39560e7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/kernel/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202302221852.fPvgpgS6-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/arm64/kernel/alternative.c:147:6: warning: no previous prototype for 'summarize_alternatives' [-Wmissing-prototypes]
     147 | void summarize_alternatives(const struct alt_region *region)
         |      ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kernel/alternative.c:358:14: warning: no previous prototype for 'alt_cb_patch_nops' [-Wmissing-prototypes]
     358 | noinstr void alt_cb_patch_nops(struct alt_instr *alt, __le32 *origptr,
         |              ^~~~~~~~~~~~~~~~~


vim +/summarize_alternatives +147 arch/arm64/kernel/alternative.c

   141	
   142	#define for_each_region_alt(region, alt)		\
   143		for (struct alt_instr *alt = (region)->begin;	\
   144		     (alt) < (region)->end;			\
   145		     (alt)++)
   146	
 > 147	void summarize_alternatives(const struct alt_region *region)
   148	{
   149		unsigned int entries[ARM64_NCAPS] = { 0 };
   150		unsigned int orig_len[ARM64_NCAPS] = { 0 };
   151		unsigned int repl_len[ARM64_NCAPS] = { 0 };
   152		unsigned int callbacks[ARM64_NCAPS] = { 0 };
   153	
   154		unsigned int total_entries = 0;
   155		unsigned int total_orig = 0;
   156		unsigned int total_repl = 0;
   157		unsigned int total_callbacks = 0;
   158	
   159		for_each_region_alt(region, alt) {
   160			int cap = ALT_CAP(alt);
   161	
   162			entries[cap]++;
   163			total_entries++;
   164	
   165			orig_len[cap] += alt->orig_len;
   166			total_orig += alt->orig_len;
   167	
   168			repl_len[cap] += alt->alt_len;
   169			total_repl += alt->alt_len;
   170	
   171			if (ALT_HAS_CB(alt)) {
   172				callbacks[cap]++;
   173				total_callbacks++;
   174			}
   175		}
   176	
   177		pr_info("Alternatives summary:\n"
   178			"    entries:      %6u (%6zu bytes)\n"
   179			"      standard:   %6d\n"
   180			"      callback:   %6d\n"
   181			"    instructions: %6u (%6u bytes)\n"
   182			"    replacements: %6u (%6u bytes)\n",
   183			total_entries,	total_entries * sizeof (struct alt_instr),
   184			total_entries - total_callbacks,
   185			total_callbacks,
   186			total_orig / AARCH64_INSN_SIZE, total_orig,
   187			total_repl / AARCH64_INSN_SIZE, total_repl);
   188	
   189		for (int i = 0; i < ARM64_NCAPS; i++) {
   190			if (!entries[i])
   191				continue;
   192	
   193			pr_info("cpucap %2d => entries: %5d, orig: %5d, repl: %5d, cb: %5d\n",
   194				i,
   195				entries[i],
   196				orig_len[i] / AARCH64_INSN_SIZE,
   197				repl_len[i] / AARCH64_INSN_SIZE,
   198				callbacks[i]);
   199		}
   200	}
   201	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

             reply	other threads:[~2023-02-22 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 10:20 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-01-03 18:20 [mark:arm64/alternatives/info 1/1] arch/arm64/kernel/alternative.c:147:6: warning: no previous prototype for 'summarize_alternatives' kernel test robot

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=202302221852.fPvgpgS6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.