The patch titled Subject: mm: shrinkers: fix build warnings has been added to the -mm mm-unstable branch. Its filename is mm-shrinkers-provide-shrinkers-with-names-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-shrinkers-provide-shrinkers-with-names-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Roman Gushchin <roman.gushchin@xxxxxxxxx> Subject: mm: shrinkers: fix build warnings Add __printf(a, b) attributes to shrinker functions taking shrinker name as an argument to avoid compiler warnings like: mm/shrinker_debug.c:143:9: warning: function 'shrinker_debugfs_rename' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] mm/shrinker_debug.c:217:9: warning: function 'shrinker_debugfs_rename' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] mm/vmscan.c:637:9: warning: function 'prealloc_shrinker' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] mm/vmscan.c:642:9: warning: function 'prealloc_shrinker' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] mm/vmscan.c:697:9: warning: function 'register_shrinker' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] mm/vmscan.c:702:9: warning: function 'register_shrinker' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] Link: https://lkml.kernel.org/r/Yr+ZTnLb9lJk6fJO@castle Signed-off-by: Roman Gushchin <roman.gushchin@xxxxxxxxx> Reported-by: kernel test robot <lkp@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/shrinker.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) --- a/include/linux/shrinker.h~mm-shrinkers-provide-shrinkers-with-names-fix +++ a/include/linux/shrinker.h @@ -93,9 +93,11 @@ struct shrinker { */ #define SHRINKER_NONSLAB (1 << 3) -extern int prealloc_shrinker(struct shrinker *shrinker, const char *fmt, ...); +extern int __printf(2, 3) prealloc_shrinker(struct shrinker *shrinker, + const char *fmt, ...); extern void register_shrinker_prepared(struct shrinker *shrinker); -extern int register_shrinker(struct shrinker *shrinker, const char *fmt, ...); +extern int __printf(2, 3) register_shrinker(struct shrinker *shrinker, + const char *fmt, ...); extern void unregister_shrinker(struct shrinker *shrinker); extern void free_prealloced_shrinker(struct shrinker *shrinker); extern void synchronize_shrinkers(void); @@ -103,8 +105,8 @@ extern void synchronize_shrinkers(void); #ifdef CONFIG_SHRINKER_DEBUG extern int shrinker_debugfs_add(struct shrinker *shrinker); extern void shrinker_debugfs_remove(struct shrinker *shrinker); -extern int shrinker_debugfs_rename(struct shrinker *shrinker, - const char *fmt, ...); +extern int __printf(2, 3) shrinker_debugfs_rename(struct shrinker *shrinker, + const char *fmt, ...); #else /* CONFIG_SHRINKER_DEBUG */ static inline int shrinker_debugfs_add(struct shrinker *shrinker) { @@ -113,8 +115,8 @@ static inline int shrinker_debugfs_add(s static inline void shrinker_debugfs_remove(struct shrinker *shrinker) { } -static inline int shrinker_debugfs_rename(struct shrinker *shrinker, - const char *fmt, ...) +static inline __printf(2, 3) +int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...) { return 0; } _ Patches currently in -mm which might be from roman.gushchin@xxxxxxxxx are mm-memcontrol-introduce-mem_cgroup_ino-and-mem_cgroup_get_from_ino.patch mm-shrinkers-introduce-debugfs-interface-for-memory-shrinkers.patch mm-shrinkers-provide-shrinkers-with-names.patch mm-shrinkers-provide-shrinkers-with-names-fix.patch mm-docs-document-shrinker-debugfs.patch tools-add-memcg_shrinkerpy.patch mm-shrinkers-add-scan-interface-for-shrinker-debugfs.patch mm-shrinkers-add-scan-interface-for-shrinker-debugfs-fix.patch