net/sunrpc/debugfs.c:307:8: note: in expansion of macro 'min'
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): 201506111234.AT1CSPTP%[email protected]
Quoted 20 lines · kbuild test robot
tree: git://git.linux-nfs.org/projects/trondmy/linux-nfs.git testing head: 5a2dd67f38fa155bdd17ff6c3222a77adabdd508 commit: 4a06825839889cc1756d0dd8a52d6b1071ee0263 [20/22] SUNRPC: Transport fault injection config: mn10300-allmodconfig (attached as .config)reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout4a06825839889cc1756d0dd8a52d6b1071ee0263# save the attached .config to linux build tree make.cross ARCH=mn10300All warnings (new ones prefixed by >>):
In file included from
include/linux/list.h:8:0,
frominclude/linux/wait.h:6,
frominclude/linux/fs.h:6,
frominclude/linux/debugfs.h:18,
fromnet/sunrpc/debugfs.c:7:
net/sunrpc/debugfs.c: In function 'fault_disconnect_write':
include/linux/kernel.h:723:17: warning: comparison of distinct pointer types lacks a cast
Quoted 5 lines
(void) (&_min1 == &_min2); \ ^Quoted 1 line
Quoted 1 line
net/sunrpc/debugfs.c:307:8: note: in expansion of macro 'min'len = min(len, sizeof(buffer) - 1); ^
I’m not sure why min_t() would be needed here. Both “len” and “sizeof” are size_t. Does the subtraction change the type of its result?
I can send you a patch.
Quoted 28 lines
vim +/min +307
net/sunrpc/debugfs.c291 fault_disconnect_read(struct file *filp, char
__user*user_buf,
292size_tlen,loff_t*offset)
293 {
294 char *buffer = (char *)filp->private_data;
295size_tsize;
296
297 size =sprintf(buffer, "%u\n", rpc_inject_disconnect);
298 returnsimple_read_from_buffer(user_buf, len, offset, buffer, size);
299 }
300
301 staticssize_t
302 fault_disconnect_write(struct file *filp, const char__user*user_buf,
303size_tlen,loff_t*offset)
304 {
305 char buffer[16];
306Quoted 1 line
307 len =
min(len, sizeof(buffer) - 1);308 if (
copy_from_user(buffer, user_buf, len))
309 return-EFAULT;
310 buffer[len] = '\0';
311 if (kstrtouint(buffer, 10, &rpc_inject_disconnect))
312 return-EINVAL;
313 return len;
314 }
315
Quoted 4 lines
---
0-DAY kernel test infrastructure Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
<.config.txt>
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com