From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [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'
Date: Mon, 07 Sep 2020 13:14:57 +0800 [thread overview]
Message-ID: <202009071353.BAcEbnvy%lkp@intel.com> (raw)
[-- 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 --]
reply other threads:[~2020-09-07 5:14 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=202009071353.BAcEbnvy%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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 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.