mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Maninder Singh <maninder1.s@samsung.com>,
	mcgrof@kernel.org, pmladek@suse.com, rostedt@goodmis.org,
	senozhatsky@chromium.org, andriy.shevchenko@linux.intel.com,
	linux@rasmusvillemoes.dk, akpm@linux-foundation.org,
	wangkefeng.wang@huawei.com
Cc: kbuild-all@lists.01.org, v.narang@samsung.com,
	swboyd@chromium.org, ojeda@kernel.or,
	linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org,
	avimalin@gmail.com, atomlin@redhat.com,
	Maninder Singh <maninder1.s@samsung.com>
Subject: Re: [PATCH 1/1] kallsyms: enhance %pS/s/b printing when KALLSYSMS is disabled
Date: Tue, 1 Mar 2022 01:35:02 +0800	[thread overview]
Message-ID: <202202281853.EofvQRmv-lkp@intel.com> (raw)
In-Reply-To: <20220228053447.1584704-1-maninder1.s@samsung.com>

Hi Maninder,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hnaz-mm/master]
[also build test WARNING on next-20220225]
[cannot apply to mcgrof/modules-next linus/master v5.17-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Maninder-Singh/kallsyms-enhance-pS-s-b-printing-when-KALLSYSMS-is-disabled/20220228-140105
base:   https://github.com/hnaz/linux-mm master
config: alpha-randconfig-r032-20220227 (https://download.01.org/0day-ci/archive/20220228/202202281853.EofvQRmv-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.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://github.com/0day-ci/linux/commit/fbad94837350bb7c5b1b0c33648f8b20eff0150a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Maninder-Singh/kallsyms-enhance-pS-s-b-printing-when-KALLSYSMS-is-disabled/20220228-140105
        git checkout fbad94837350bb7c5b1b0c33648f8b20eff0150a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash

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

All warnings (new ones prefixed by >>):

   lib/vsprintf.c: In function 'sprint_module_info':
>> lib/vsprintf.c:993:13: warning: variable 'modbuildid' set but not used [-Wunused-but-set-variable]
     993 |         int modbuildid = 0;
         |             ^~~~~~~~~~
   lib/vsprintf.c: In function 'va_format':
   lib/vsprintf.c:1761:9: warning: function 'va_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    1761 |         buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va);
         |         ^~~


vim +/modbuildid +993 lib/vsprintf.c

   983	
   984	#if !defined(CONFIG_KALLSYMS) && defined(CONFIG_MODULES)
   985	static int sprint_module_info(char *buf, char *end, unsigned long value,
   986				     const char *fmt)
   987	{
   988		struct module *mod;
   989		unsigned long offset = 1;
   990		unsigned long base;
   991		int ret = 0;
   992		const char *modname;
 > 993		int modbuildid = 0;
   994		int len;
   995	#if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID)
   996		const unsigned char *buildid = NULL;
   997	#endif
   998	
   999		if (is_ksym_addr(value))
  1000			return 0;
  1001	
  1002		if (*fmt == 'B' && fmt[1] == 'b')
  1003			modbuildid = 1;
  1004		else if (*fmt == 'S' && (fmt[1] == 'b' || (fmt[1] == 'R' && fmt[2] == 'b')))
  1005			modbuildid = 1;
  1006		else if (*fmt != 's') {
  1007			/*
  1008			 * do nothing.
  1009			 */
  1010		} else
  1011			offset = 0;
  1012	
  1013		preempt_disable();
  1014		mod = __module_address(value);
  1015		if (mod) {
  1016			ret = 1;
  1017			modname = mod->name;
  1018	#if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID)
  1019			if (modbuildid)
  1020				buildid = mod->build_id;
  1021	#endif
  1022			if (offset) {
  1023				base = (unsigned long)mod->core_layout.base;
  1024				offset = value - base;
  1025			}
  1026		}
  1027	
  1028		preempt_enable();
  1029		if (!ret)
  1030			return 0;
  1031	
  1032		/* address belongs to module */
  1033		if (offset)
  1034			len = sprintf(buf, "0x%lx+0x%lx", base, offset);
  1035		else
  1036			len = sprintf(buf, "0x%lx", value);
  1037	
  1038		len += sprintf(buf + len, " [%s", modname);
  1039	#if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID)
  1040		if (modbuildid && buildid) {
  1041			/* build ID should match length of sprintf */
  1042			static_assert(sizeof(typeof_member(struct module, build_id)) == 20);
  1043			len += sprintf(buf + len, " %20phN", buildid);
  1044		}
  1045	#endif
  1046		len += sprintf(buf + len, "]");
  1047	
  1048		return len;
  1049	}
  1050	#else
  1051	static inline int sprint_module_info(char *buf, char *end, unsigned long value,
  1052				     const char *fmt)
  1053	{
  1054		return 0;
  1055	}
  1056	#endif
  1057	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

      parent reply	other threads:[~2022-02-28 17:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220228053457epcas5p1dac3fced39d1594f8fdfc5e64e23ac73@epcas5p1.samsung.com>
2022-02-28  5:34 ` Maninder Singh
2022-02-28 12:03   ` Andy Shevchenko
2022-02-28 17:10     ` Petr Mladek
2022-02-28 15:35   ` Luis Chamberlain
2022-02-28 17:35   ` kernel test robot [this message]

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=202202281853.EofvQRmv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=atomlin@redhat.com \
    --cc=avimalin@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=maninder1.s@samsung.com \
    --cc=mcgrof@kernel.org \
    --cc=ojeda@kernel.or \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=swboyd@chromium.org \
    --cc=v.narang@samsung.com \
    --cc=wangkefeng.wang@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®