All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-review:UPDATE-20200907-111911/Joe-Perches/sysfs-Add-sysfs_emit-and-sysfs_emit_at-to-format-sysfs-output/20200830-074855 1/1] fs/sysfs/file.c:721:5: warning: no previous prototype for 'sysfs_emit'
@ 2020-09-07  5:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-09-07  5:14 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4926 bytes --]

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20200907-111911/Joe-Perches/sysfs-Add-sysfs_emit-and-sysfs_emit_at-to-format-sysfs-output/20200830-074855
head:   a1cb41f3093db450e96f971ccb8187837a9ed6e3
commit: a1cb41f3093db450e96f971ccb8187837a9ed6e3 [1/1] sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output
config: ia64-randconfig-r013-20200907 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout a1cb41f3093db450e96f971ccb8187837a9ed6e3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

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 >>):

   In file included from arch/ia64/include/asm/pgtable.h:154,
                    from include/linux/pgtable.h:6,
                    from arch/ia64/include/asm/uaccess.h:40,
                    from include/linux/uaccess.h:9,
                    from include/linux/sched/task.h:11,
                    from include/linux/sched/signal.h:9,
                    from include/linux/rcuwait.h:6,
                    from include/linux/percpu-rwsem.h:7,
                    from include/linux/fs.h:33,
                    from include/linux/seq_file.h:11,
                    from fs/sysfs/file.c:17:
   arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
   arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
     137 |  unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
         |                                         ^~~~~~~
   fs/sysfs/file.c: At top level:
>> fs/sysfs/file.c:721:5: warning: no previous prototype for 'sysfs_emit' [-Wmissing-prototypes]
     721 | int sysfs_emit(char *buf, const char *fmt, ...)
         |     ^~~~~~~~~~
   fs/sysfs/file.c: In function 'sysfs_emit':
>> fs/sysfs/file.c:731:2: warning: function 'sysfs_emit' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
     731 |  len = vscnprintf(buf, PAGE_SIZE, fmt, args);
         |  ^~~
   fs/sysfs/file.c: At top level:
>> fs/sysfs/file.c:749:5: warning: no previous prototype for 'sysfs_emit_at' [-Wmissing-prototypes]
     749 | int sysfs_emit_at(char *buf, int at, const char *fmt, ...)
         |     ^~~~~~~~~~~~~
   fs/sysfs/file.c: In function 'sysfs_emit_at':
>> fs/sysfs/file.c:759:2: warning: function 'sysfs_emit_at' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
     759 |  len = vscnprintf(buf + at, PAGE_SIZE - at, fmt, args);
         |  ^~~

# https://github.com/0day-ci/linux/commit/a1cb41f3093db450e96f971ccb8187837a9ed6e3
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review UPDATE-20200907-111911/Joe-Perches/sysfs-Add-sysfs_emit-and-sysfs_emit_at-to-format-sysfs-output/20200830-074855
git checkout a1cb41f3093db450e96f971ccb8187837a9ed6e3
vim +/sysfs_emit +721 fs/sysfs/file.c

   711	
   712	/**
   713	 *	sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
   714	 *	@buf:	start of PAGE_SIZE buffer.
   715	 *	@fmt:	format
   716	 *	@...:	optional arguments to @format
   717	 *
   718	 *
   719	 * Returns number of characters written to @buf.
   720	 */
 > 721	int sysfs_emit(char *buf, const char *fmt, ...)
   722	{
   723		va_list args;
   724		int len;
   725	
   726		if (WARN(!buf || offset_in_page(buf),
   727			 "invalid sysfs_emit: buf:%p\n", buf))
   728			return 0;
   729	
   730		va_start(args, fmt);
 > 731		len = vscnprintf(buf, PAGE_SIZE, fmt, args);
   732		va_end(args);
   733	
   734		return len;
   735	}
   736	EXPORT_SYMBOL_GPL(sysfs_emit);
   737	
   738	/**
   739	 *	sysfs_emit_at - scnprintf equivalent, aware of PAGE_SIZE buffer.
   740	 *	@buf:	start of PAGE_SIZE buffer.
   741	 *	@at:	offset in @buf to start write in bytes
   742	 *		@at must be >= 0 && < PAGE_SIZE
   743	 *	@fmt:	format
   744	 *	@...:	optional arguments to @fmt
   745	 *
   746	 *
   747	 * Returns number of characters written starting@&@buf[@at].
   748	 */
 > 749	int sysfs_emit_at(char *buf, int at, const char *fmt, ...)
   750	{
   751		va_list args;
   752		int len;
   753	
   754		if (WARN(!buf || offset_in_page(buf) || at < 0 || at >= PAGE_SIZE,
   755			 "invalid sysfs_emit_at: buf:%p at:%d\n", buf, at))
   756			return 0;
   757	
   758		va_start(args, fmt);
 > 759		len = vscnprintf(buf + at, PAGE_SIZE - at, fmt, args);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 26635 bytes --]

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

only message in thread, other threads:[~2020-09-07  5:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-07  5:14 [linux-review:UPDATE-20200907-111911/Joe-Perches/sysfs-Add-sysfs_emit-and-sysfs_emit_at-to-format-sysfs-output/20200830-074855 1/1] fs/sysfs/file.c:721:5: warning: no previous prototype for 'sysfs_emit' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.