tree:
git://git.infradead.org/users/hch/misc.git set_fs-sysctl
head: 29b9c55afc43fafa2c77b8a7caf8d48ff93234e2
commit: 29b9c55afc43fafa2c77b8a7caf8d48ff93234e2 [6/6] sysctl: pass kernel pointers to
->proc_handler
config: mips-lasat_defconfig (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 29b9c55afc43fafa2c77b8a7caf8d48ff93234e2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/mips/lasat/sysctl.c: In function 'proc_lasat_ip':
> arch/mips/lasat/sysctl.c:98:6: error: assignment to
'char' from 'char *' makes integer from pointer without a cast
[-Werror=int-conversion]
98 | c = p++;
| ^
arch/mips/lasat/sysctl.c:125:10: error: dereferencing 'void *' pointer
[-Werror]
125 | buffer[len] = '\n';
| ^
> arch/mips/lasat/sysctl.c:125:16: error: invalid use of void
expression
125 | buffer[len] = '\n';
| ^
cc1: all warnings being treated as errors
vim +98 arch/mips/lasat/sysctl.c
78
79 #ifdef CONFIG_INET
80 int proc_lasat_ip(struct ctl_table *table, int write,
81 void *buffer, size_t *lenp, loff_t *ppos)
82 {
83 unsigned int ip;
84 char *p, c;
85 int len;
86 char ipbuf[32];
87
88 if (!table->data || !table->maxlen || !*lenp ||
89 (*ppos && !write)) {
90 *lenp = 0;
91 return 0;
92 }
93
94 if (write) {
95 len = 0;
96 p = buffer;
97 while (len < *lenp) {
98 c = p++;
99 if (c == 0 || c == '\n')
100 break;
101 len++;
102 }
103 if (len >= sizeof(ipbuf)-1)
104 len = sizeof(ipbuf) - 1;
105 memcpy(ipbuf, buffer, len);
106 ipbuf[len] = 0;
107 *ppos += *lenp;
108 /* Now see if we can convert it to a valid IP */
109 ip = in_aton(ipbuf);
110 *(unsigned int *)(table->data) = ip;
111 lasat_write_eeprom_info();
112 } else {
113 ip = *(unsigned int *)(table->data);
114 sprintf(ipbuf, "%d.%d.%d.%d",
115 (ip) & 0xff,
116 (ip >> 8) & 0xff,
117 (ip >> 16) & 0xff,
118 (ip >> 24) & 0xff);
119 len = strlen(ipbuf);
120 if (len > *lenp)
121 len = *lenp;
122 if (len)
123 memcpy(buffer, ipbuf, len);
124 if (len < *lenp) {
125 buffer[len] = '\n';
126 len++;
127 }
128 *lenp = len;
129 *ppos += len;
130 }
131
132 return 0;
133 }
134 #endif
135
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org