linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [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
@ 2023-12-11 11:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-11 11:57 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: oe-kbuild-all, Linux Memory Management List

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-11 11:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 11:57 [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 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox