linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jagdish Gediya <jvgediya@linux.ibm.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, rafael@kernel.org,
	akpm@linux-foundation.org
Cc: kbuild-all@lists.01.org, keescook@chromium.org,
	andriy.shevchenko@linux.intel.com, geert@linux-m68k.org,
	linux@roeck-us.net, adobriyan@gmail.com,
	Jagdish Gediya <jvgediya@linux.ibm.com>
Subject: Re: [PATCH] kobject: Refactor kobject_set_name_vargs()
Date: Sat, 7 May 2022 03:56:51 +0800	[thread overview]
Message-ID: <202205070311.4T8ZKSWq-lkp@intel.com> (raw)
In-Reply-To: <20220506133309.36794-1-jvgediya@linux.ibm.com>

Hi Jagdish,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on driver-core/driver-core-testing]
[also build test WARNING on hnaz-mm/master linux/master linus/master v5.18-rc5 next-20220506]
[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/intel-lab-lkp/linux/commits/Jagdish-Gediya/kobject-Refactor-kobject_set_name_vargs/20220506-213448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git bc443c31def574e3bfaed50cb493b8305ad79435
config: um-i386_defconfig (https://download.01.org/0day-ci/archive/20220507/202205070311.4T8ZKSWq-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/4aac95bc8a052e61d5013a25a2099ed711e88fde
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jagdish-Gediya/kobject-Refactor-kobject_set_name_vargs/20220506-213448
        git checkout 4aac95bc8a052e61d5013a25a2099ed711e88fde
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=um SUBARCH=i386 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 >>):

   mm/util.c: In function 'set_name_vargs':
>> mm/util.c:128:9: warning: function 'set_name_vargs' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
     128 |         s = kvasprintf_const(GFP_KERNEL, fmt, vargs);
         |         ^


vim +128 mm/util.c

   114	
   115	/**
   116	 * set_name_vargs() - Set the name as per format
   117	 * @name: pointer to point to the name as per format
   118	 * @fmt: format string used to build the name
   119	 * @vargs: vargs to format the string.
   120	 */
   121	int set_name_vargs(const char **name, const char *fmt, va_list vargs)
   122	{
   123		const char *s;
   124	
   125		if (*name && !fmt)
   126			return 0;
   127	
 > 128		s = kvasprintf_const(GFP_KERNEL, fmt, vargs);
   129		if (!s)
   130			return -ENOMEM;
   131	
   132		/*
   133		 * ewww... some of these buggers have '/' in the name ... If
   134		 * that's the case, we need to make sure we have an actual
   135		 * allocated copy to modify, since kvasprintf_const may have
   136		 * returned something from .rodata.
   137		 */
   138		if (strchr(s, '/')) {
   139			char *t;
   140	
   141			t = kstrdup(s, GFP_KERNEL);
   142			kfree_const(s);
   143			if (!t)
   144				return -ENOMEM;
   145			strreplace(t, '/', '!');
   146			s = t;
   147		}
   148		kfree_const(*name);
   149		*name = s;
   150	
   151		return 0;
   152	}
   153	EXPORT_SYMBOL(set_name_vargs);
   154	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


      parent reply	other threads:[~2022-05-06 19:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 13:33 [PATCH] kobject: Refactor kobject_set_name_vargs() Jagdish Gediya
2022-05-06 14:02 ` Greg KH
2022-05-06 14:29   ` Jagdish Gediya
2022-05-06 14:45     ` Greg KH
2022-05-06 14:46 ` David Laight
2022-05-06 17:24   ` Jagdish Gediya
2022-05-07 10:01     ` David Laight
2022-05-06 19:56 ` 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=202205070311.4T8ZKSWq-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jvgediya@linux.ibm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@roeck-us.net \
    --cc=rafael@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).