kernel/time/clocksource.c:1053:9: warning: no previous prototype for 'sysfs_get_uname'
From: kernel test robot
Date: Mon Sep 27 2021 - 22:01:20 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: 686092e7daaa9f43396c57ea0044799e47f0d9da parisc: use legacy_timer_tick
date: 11 months ago
config: parisc-buildonly-randconfig-r005-20210927 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 11.2.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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=686092e7daaa9f43396c57ea0044799e47f0d9da
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 686092e7daaa9f43396c57ea0044799e47f0d9da
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
>> kernel/time/clocksource.c:1053:9: warning: no previous prototype for 'sysfs_get_uname' [-Wmissing-prototypes]
1053 | ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)
| ^~~~~~~~~~~~~~~
vim +/sysfs_get_uname +1053 kernel/time/clocksource.c
734efb467b31e5 John Stultz 2006-06-26 1052
891292a767c245 Patrick Palka 2013-10-11 @1053 ssize_t sysfs_get_uname(const char *buf, char *dst, size_t cnt)
29b5407819f597 Thomas Gleixner 2013-04-25 1054 {
29b5407819f597 Thomas Gleixner 2013-04-25 1055 size_t ret = cnt;
29b5407819f597 Thomas Gleixner 2013-04-25 1056
29b5407819f597 Thomas Gleixner 2013-04-25 1057 /* strings from sysfs write are not 0 terminated! */
29b5407819f597 Thomas Gleixner 2013-04-25 1058 if (!cnt || cnt >= CS_NAME_LEN)
29b5407819f597 Thomas Gleixner 2013-04-25 1059 return -EINVAL;
29b5407819f597 Thomas Gleixner 2013-04-25 1060
29b5407819f597 Thomas Gleixner 2013-04-25 1061 /* strip of \n: */
29b5407819f597 Thomas Gleixner 2013-04-25 1062 if (buf[cnt-1] == '\n')
29b5407819f597 Thomas Gleixner 2013-04-25 1063 cnt--;
29b5407819f597 Thomas Gleixner 2013-04-25 1064 if (cnt > 0)
29b5407819f597 Thomas Gleixner 2013-04-25 1065 memcpy(dst, buf, cnt);
29b5407819f597 Thomas Gleixner 2013-04-25 1066 dst[cnt] = 0;
29b5407819f597 Thomas Gleixner 2013-04-25 1067 return ret;
29b5407819f597 Thomas Gleixner 2013-04-25 1068 }
29b5407819f597 Thomas Gleixner 2013-04-25 1069
:::::: The code at line 1053 was first introduced by commit
:::::: 891292a767c2453af0e5be9465e95b06b4b29ebe time: Fix signedness bug in sysfs_get_uname() and its callers
:::::: TO: Patrick Palka <patrick@xxxxxxxxxxxx>
:::::: CC: John Stultz <john.stultz@xxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip