llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [cel:nfsd-testing 18/18] fs/nfsd/blocklayoutxdr.c:166:1: error: function definition is not allowed here
@ 2024-06-16 22:49 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-06-16 22:49 UTC (permalink / raw)
  To: Chuck Lever; +Cc: llvm, oe-kbuild-all

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux nfsd-testing
head:   c84c489cded2df7bcd07b5205179cd19b0f0718b
commit: c84c489cded2df7bcd07b5205179cd19b0f0718b [18/18] nfsd/blocklayout: Clean up dprintk's
config: s390-randconfig-001-20240617 (https://download.01.org/0day-ci/archive/20240617/202406170656.QJXrQzOj-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240617/202406170656.QJXrQzOj-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406170656.QJXrQzOj-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from fs/nfsd/blocklayoutxdr.c:5:
   In file included from include/linux/sunrpc/svc.h:17:
   In file included from include/linux/sunrpc/xdr.h:17:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                                                           ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
     102 | #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
         |                                                      ^
   In file included from fs/nfsd/blocklayoutxdr.c:5:
   In file included from include/linux/sunrpc/svc.h:17:
   In file included from include/linux/sunrpc/xdr.h:17:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                                                           ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
     115 | #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
         |                                                      ^
   In file included from fs/nfsd/blocklayoutxdr.c:5:
   In file included from include/linux/sunrpc/svc.h:17:
   In file included from include/linux/sunrpc/xdr.h:17:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     693 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     701 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     709 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     718 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     727 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     736 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
>> fs/nfsd/blocklayoutxdr.c:166:1: error: function definition is not allowed here
     166 | {
         | ^
>> fs/nfsd/blocklayoutxdr.c:201:2: error: expected '}'
     201 | }
         |  ^
   fs/nfsd/blocklayoutxdr.c:115:1: note: to match this '{'
     115 | {
         | ^
   12 warnings and 2 errors generated.


vim +166 fs/nfsd/blocklayoutxdr.c

f99d4fbdae6765 Christoph Hellwig 2016-03-04  162  
f99d4fbdae6765 Christoph Hellwig 2016-03-04  163  int
f99d4fbdae6765 Christoph Hellwig 2016-03-04  164  nfsd4_scsi_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp,
f99d4fbdae6765 Christoph Hellwig 2016-03-04  165  		u32 block_size)
f99d4fbdae6765 Christoph Hellwig 2016-03-04 @166  {
f99d4fbdae6765 Christoph Hellwig 2016-03-04  167  	struct iomap *iomaps;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  168  	u32 nr_iomaps, expected, i;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  169  
c84c489cded2df Chuck Lever       2024-06-16  170  	if (unlikely(len < XDR_UNIT))
f99d4fbdae6765 Christoph Hellwig 2016-03-04  171  		return -EINVAL;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  172  
f99d4fbdae6765 Christoph Hellwig 2016-03-04  173  	nr_iomaps = be32_to_cpup(p++);
c84c489cded2df Chuck Lever       2024-06-16  174  	expected = XDR_UNIT + nr_iomaps * PNFS_SCSI_RANGE_SIZE;
c84c489cded2df Chuck Lever       2024-06-16  175  	if (unlikely(len != expected))
f99d4fbdae6765 Christoph Hellwig 2016-03-04  176  		return -EINVAL;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  177  
f99d4fbdae6765 Christoph Hellwig 2016-03-04  178  	iomaps = kcalloc(nr_iomaps, sizeof(*iomaps), GFP_KERNEL);
c84c489cded2df Chuck Lever       2024-06-16  179  	if (unlikely(!iomaps))
f99d4fbdae6765 Christoph Hellwig 2016-03-04  180  		return -ENOMEM;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  181  
f99d4fbdae6765 Christoph Hellwig 2016-03-04  182  	for (i = 0; i < nr_iomaps; i++) {
f99d4fbdae6765 Christoph Hellwig 2016-03-04  183  		u64 val;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  184  
f99d4fbdae6765 Christoph Hellwig 2016-03-04  185  		p = xdr_decode_hyper(p, &val);
c84c489cded2df Chuck Lever       2024-06-16  186  		if (unlikely(val & (block_size - 1)))
f99d4fbdae6765 Christoph Hellwig 2016-03-04  187  			goto fail;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  188  		iomaps[i].offset = val;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  189  
f99d4fbdae6765 Christoph Hellwig 2016-03-04  190  		p = xdr_decode_hyper(p, &val);
c84c489cded2df Chuck Lever       2024-06-16  191  		if (unlikely(val & (block_size - 1)))
f99d4fbdae6765 Christoph Hellwig 2016-03-04  192  			goto fail;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  193  		iomaps[i].length = val;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  194  	}
f99d4fbdae6765 Christoph Hellwig 2016-03-04  195  
f99d4fbdae6765 Christoph Hellwig 2016-03-04  196  	*iomapp = iomaps;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  197  	return nr_iomaps;
f99d4fbdae6765 Christoph Hellwig 2016-03-04  198  fail:
f99d4fbdae6765 Christoph Hellwig 2016-03-04  199  	kfree(iomaps);
f99d4fbdae6765 Christoph Hellwig 2016-03-04  200  	return -EINVAL;
f99d4fbdae6765 Christoph Hellwig 2016-03-04 @201  }

:::::: The code at line 166 was first introduced by commit
:::::: f99d4fbdae6765d0bb4ed5441f6fa1f036122d59 nfsd: add SCSI layout support

:::::: TO: Christoph Hellwig <hch@lst.de>
:::::: CC: J. Bruce Fields <bfields@redhat.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2024-06-16 22:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-16 22:49 [cel:nfsd-testing 18/18] fs/nfsd/blocklayoutxdr.c:166:1: error: function definition is not allowed here kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).