linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kent Overstreet <kmo@daterainc.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 5967/6992] fs/bcachefs/chardev.c:54:9: warning: function 'run_thread_with_file' might be a candidate for 'gnu_printf' format attribute
Date: Mon, 11 Dec 2023 19:57:30 +0800	[thread overview]
Message-ID: <202312111931.SukjK6yt-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   bbd220ce4e29ed55ab079007cff0b550895258eb
commit: 48398ac2bfbc356521a3415c2ea0d0a99e95b7ca [5967/6992] bcachefs: thread_with_file
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20231211/202312111931.SukjK6yt-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231211/202312111931.SukjK6yt-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312111931.SukjK6yt-lkp@intel.com/

All warnings (new ones prefixed by >>):

   fs/bcachefs/chardev.c: In function 'run_thread_with_file':
>> fs/bcachefs/chardev.c:54:9: warning: function 'run_thread_with_file' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
      54 |         prt_vprintf(&name, fmt, args);
         |         ^~~~~~~~~~~


vim +54 fs/bcachefs/chardev.c

    42	
    43	static int run_thread_with_file(struct thread_with_file *thr,
    44					const struct file_operations *fops,
    45					int (*fn)(void *), const char *fmt, ...)
    46	{
    47		va_list args;
    48		struct file *file = NULL;
    49		int ret, fd = -1;
    50		struct printbuf name = PRINTBUF;
    51		unsigned fd_flags = O_RDONLY|O_CLOEXEC|O_NONBLOCK;
    52	
    53		va_start(args, fmt);
  > 54		prt_vprintf(&name, fmt, args);
    55		va_end(args);
    56	
    57		thr->ret = 0;
    58		thr->task = kthread_create(fn, thr, name.buf);
    59		ret = PTR_ERR_OR_ZERO(thr->task);
    60		if (ret)
    61			goto err;
    62	
    63		ret = get_unused_fd_flags(fd_flags);
    64		if (ret < 0)
    65			goto err_stop_task;
    66		fd = ret;
    67	
    68		file = anon_inode_getfile(name.buf, fops, thr, fd_flags);
    69		ret = PTR_ERR_OR_ZERO(file);
    70		if (ret)
    71			goto err_put_fd;
    72	
    73		fd_install(fd, file);
    74		get_task_struct(thr->task);
    75		wake_up_process(thr->task);
    76		printbuf_exit(&name);
    77		return fd;
    78	err_put_fd:
    79		put_unused_fd(fd);
    80	err_stop_task:
    81		kthread_stop(thr->task);
    82	err:
    83		printbuf_exit(&name);
    84		return ret;
    85	}
    86	

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


                 reply	other threads:[~2023-12-11 11:58 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=202312111931.SukjK6yt-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kmo@daterainc.com \
    --cc=linux-mm@kvack.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox