From: kernel test robot <lkp@intel.com>
To: Roman Gushchin <roman.gushchin@linux.dev>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 6710/7019] mm/shrinker_debug.c:143:9: warning: function 'shrinker_debugfs_rename' might be a candidate for 'gnu_printf' format attribute
Date: Thu, 30 Jun 2022 18:27:07 +0800 [thread overview]
Message-ID: <202206301859.UodBCrva-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 6cc11d2a1759275b856e464265823d94aabd5eaf
commit: cb0552df1adc17e54710d5328b78ba18596679e1 [6710/7019] mm: shrinkers: provide shrinkers with names
config: i386-randconfig-a001 (https://download.01.org/0day-ci/archive/20220630/202206301859.UodBCrva-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=cb0552df1adc17e54710d5328b78ba18596679e1
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout cb0552df1adc17e54710d5328b78ba18596679e1
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
mm/shrinker_debug.c: In function 'shrinker_debugfs_rename':
>> mm/shrinker_debug.c:143:9: warning: function 'shrinker_debugfs_rename' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
143 | new = kvasprintf_const(GFP_KERNEL, fmt, ap);
| ^~~
--
mm/vmscan.c: In function 'prealloc_shrinker':
>> mm/vmscan.c:642:9: warning: function 'prealloc_shrinker' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
642 | shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
| ^~~~~~~~
mm/vmscan.c: In function 'register_shrinker':
>> mm/vmscan.c:702:9: warning: function 'register_shrinker' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
702 | shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap);
| ^~~~~~~~
vim +143 mm/shrinker_debug.c
133
134 int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...)
135 {
136 struct dentry *entry;
137 char buf[128];
138 const char *new, *old;
139 va_list ap;
140 int ret = 0;
141
142 va_start(ap, fmt);
> 143 new = kvasprintf_const(GFP_KERNEL, fmt, ap);
144 va_end(ap);
145
146 if (!new)
147 return -ENOMEM;
148
149 down_write(&shrinker_rwsem);
150
151 old = shrinker->name;
152 shrinker->name = new;
153
154 if (shrinker->debugfs_entry) {
155 snprintf(buf, sizeof(buf), "%s-%d", shrinker->name,
156 shrinker->debugfs_id);
157
158 entry = debugfs_rename(shrinker_debugfs_root,
159 shrinker->debugfs_entry,
160 shrinker_debugfs_root, buf);
161 if (IS_ERR(entry))
162 ret = PTR_ERR(entry);
163 else
164 shrinker->debugfs_entry = entry;
165 }
166
167 up_write(&shrinker_rwsem);
168
169 kfree_const(old);
170
171 return ret;
172 }
173 EXPORT_SYMBOL(shrinker_debugfs_rename);
174
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-06-30 10:27 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=202206301859.UodBCrva-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=roman.gushchin@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;
as well as URLs for NNTP newsgroup(s).