All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v5 bpf-next 2/6] bpf: move to generic BTF show support, apply it to seq files/strings
Date: Sat, 19 Sep 2020 02:20:34 +0800	[thread overview]
Message-ID: <202009190248.GLnmik01%lkp@intel.com> (raw)
In-Reply-To: <1600436075-2961-3-git-send-email-alan.maguire@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 4290 bytes --]

Hi Alan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Alan-Maguire/bpf-add-helpers-to-support-BTF-based-kernel-data-display/20200918-213932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: sparc-randconfig-p002-20200917 (attached as .config)
compiler: sparc-linux-gcc (GCC) 9.3.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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc 

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 >>):

>> kernel/bpf/btf.c:5310:6: warning: no previous prototype for 'btf_type_show' [-Wmissing-prototypes]
    5310 | void btf_type_show(const struct btf *btf, u32 type_id, void *obj,
         |      ^~~~~~~~~~~~~
   kernel/bpf/btf.c: In function 'btf_seq_show':
>> kernel/bpf/btf.c:5327:22: warning: function 'btf_seq_show' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    5327 |  seq_vprintf((struct seq_file *)show->target, fmt, args);
         |                      ^~~~~~~~
   kernel/bpf/btf.c: In function 'btf_snprintf_show':
>> kernel/bpf/btf.c:5357:2: warning: function 'btf_snprintf_show' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    5357 |  len = vsnprintf(show->target, ssnprintf->len_left, fmt, args);
         |  ^~~

# https://github.com/0day-ci/linux/commit/a85186d405b24251bfd7179ae1949f3458e9702d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alan-Maguire/bpf-add-helpers-to-support-BTF-based-kernel-data-display/20200918-213932
git checkout a85186d405b24251bfd7179ae1949f3458e9702d
vim +/btf_type_show +5310 kernel/bpf/btf.c

  5309	
> 5310	void btf_type_show(const struct btf *btf, u32 type_id, void *obj,
  5311			   struct btf_show *show)
  5312	{
  5313		const struct btf_type *t = btf_type_by_id(btf, type_id);
  5314	
  5315		show->btf = btf;
  5316		memset(&show->state, 0, sizeof(show->state));
  5317		memset(&show->obj, 0, sizeof(show->obj));
  5318	
  5319		btf_type_ops(t)->show(btf, t, type_id, obj, 0, show);
  5320	}
  5321	
  5322	static void btf_seq_show(struct btf_show *show, const char *fmt, ...)
  5323	{
  5324		va_list args;
  5325	
  5326		va_start(args, fmt);
> 5327		seq_vprintf((struct seq_file *)show->target, fmt, args);
  5328		va_end(args);
  5329	}
  5330	
  5331	void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj,
  5332				struct seq_file *m)
  5333	{
  5334		struct btf_show sseq;
  5335	
  5336		sseq.target = m;
  5337		sseq.showfn = btf_seq_show;
  5338		sseq.flags = BTF_SHOW_NONAME | BTF_SHOW_COMPACT | BTF_SHOW_ZERO |
  5339			     BTF_SHOW_UNSAFE;
  5340	
  5341		btf_type_show(btf, type_id, obj, &sseq);
  5342	}
  5343	
  5344	struct btf_show_snprintf {
  5345		struct btf_show show;
  5346		int len_left;		/* space left in string */
  5347		int len;		/* length we would have written */
  5348	};
  5349	
  5350	static void btf_snprintf_show(struct btf_show *show, const char *fmt, ...)
  5351	{
  5352		struct btf_show_snprintf *ssnprintf = (struct btf_show_snprintf *)show;
  5353		va_list args;
  5354		int len;
  5355	
  5356		va_start(args, fmt);
> 5357		len = vsnprintf(show->target, ssnprintf->len_left, fmt, args);
  5358		va_end(args);
  5359	
  5360		if (len < 0) {
  5361			ssnprintf->len_left = 0;
  5362			ssnprintf->len = len;
  5363		} else if (len > ssnprintf->len_left) {
  5364			/* no space, drive on to get length we would have written */
  5365			ssnprintf->len_left = 0;
  5366			ssnprintf->len += len;
  5367		} else {
  5368			ssnprintf->len_left -= len;
  5369			ssnprintf->len += len;
  5370			show->target += len;
  5371		}
  5372	}
  5373	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 23503 bytes --]

  reply	other threads:[~2020-09-18 18:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 13:34 [PATCH v5 bpf-next 0/6] bpf: add helpers to support BTF-based kernel data display Alan Maguire
2020-09-18 13:34 ` [PATCH v5 bpf-next 1/6] bpf: provide function to get vmlinux BTF information Alan Maguire
2020-09-18 13:34 ` [PATCH v5 bpf-next 2/6] bpf: move to generic BTF show support, apply it to seq files/strings Alan Maguire
2020-09-18 18:20   ` kernel test robot [this message]
2020-09-18 18:32   ` kernel test robot
2020-09-18 18:32   ` [RFC PATCH] bpf: btf_type_show() can be static kernel test robot
2020-09-18 18:44   ` [PATCH v5 bpf-next 2/6] bpf: move to generic BTF show support, apply it to seq files/strings kernel test robot
2020-09-18 13:34 ` [PATCH v5 bpf-next 3/6] bpf: add bpf_btf_snprintf helper Alan Maguire
2020-09-18 23:53   ` kernel test robot
2020-09-19  0:20   ` kernel test robot
2020-09-18 13:34 ` [PATCH v5 bpf-next 4/6] selftests/bpf: add bpf_btf_snprintf helper tests Alan Maguire
2020-09-18 13:34 ` [PATCH v5 bpf-next 5/6] bpf: add bpf_seq_btf_write helper Alan Maguire
2020-09-22  1:10   ` Alexei Starovoitov
2020-09-18 13:34 ` [PATCH v5 bpf-next 6/6] selftests/bpf: add test for " Alan Maguire

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=202009190248.GLnmik01%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.