[jlayton:ceph-fscrypt 53/53] net/ceph/osd_client.c:5775:3: error: expected expression

From: kernel test robot
Date: Fri Jan 28 2022 - 21:00:53 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt
head: 3f014b82b65ebbf30b8e4cd0b307f1f2794d183f
commit: 3f014b82b65ebbf30b8e4cd0b307f1f2794d183f [53/53] libceph: define a structure to track SPARSE_READ reply processing
config: hexagon-randconfig-r002-20220127 (https://download.01.org/0day-ci/archive/20220129/202201290935.AEKKkabv-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
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/jlayton/linux.git/commit/?id=3f014b82b65ebbf30b8e4cd0b307f1f2794d183f
git remote add jlayton https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git
git fetch --no-tags jlayton ceph-fscrypt
git checkout 3f014b82b65ebbf30b8e4cd0b307f1f2794d183f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash net/ceph/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

>> net/ceph/osd_client.c:5775:3: error: expected expression
u64 off = le64_to_cpu(sr->sr_extent[sr->sr_index].off);
^
>> net/ceph/osd_client.c:5776:7: warning: mixing declarations and code is a C99 extension [-Wdeclaration-after-statement]
u64 len = le64_to_cpu(sr->sr_extent[sr->sr_index].len);
^
1 warning and 1 error generated.


vim +5775 net/ceph/osd_client.c

5746
5747 static int osd_sparse_read(struct ceph_connection *con, u64 *len, char **buf)
5748 {
5749 struct ceph_osd *o = con->private;
5750 struct ceph_sparse_read *sr = &o->o_sparse_read;
5751 u32 count = __le32_to_cpu(sr->sr_count);
5752 int ret = 1;
5753
5754 switch (sr->sr_state) {
5755 case CEPH_SPARSE_READ_COUNT:
5756 /* number of extents */
5757 *len = sizeof(sr->sr_count);
5758 *buf = (char *)&sr->sr_count;
5759 sr->sr_state = CEPH_SPARSE_READ_EXTENTS;
5760 break;
5761 case CEPH_SPARSE_READ_EXTENTS:
5762 /* the extent array */
5763 *len = count * sizeof(*sr->sr_extent);
5764 if (count > 1) {
5765 /* can't use the embedded extent array */
5766 sr->sr_extent = kmalloc_array(count, sizeof(*sr->sr_extent),
5767 GFP_NOIO);
5768 if (!sr->sr_extent)
5769 return -ENOMEM;
5770 }
5771 *buf = (char *)sr->sr_extent;
5772 sr->sr_state = CEPH_SPARSE_READ_DATA;
5773 break;
5774 case CEPH_SPARSE_READ_DATA:
> 5775 u64 off = le64_to_cpu(sr->sr_extent[sr->sr_index].off);
> 5776 u64 len = le64_to_cpu(sr->sr_extent[sr->sr_index].len);
5777
5778 /* ret to 0 if this is the last extent */
5779 ++sr->sr_index;
5780 if (sr->sr_index >= count)
5781 ret = 0;
5782 break;
5783 }
5784 return ret;
5785 }
5786

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx