[jlayton:ceph-fscrypt 57/57] net/ceph/messenger_v2.c:1783:37: warning: 'struct cepn_connection' declared inside parameter list will not be visible outside of this definition or declaration

From: kernel test robot
Date: Fri Feb 11 2022 - 01:56:37 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git ceph-fscrypt
head: adf69efebc954db1aa7af7b93febbc2a1b51dc6c
commit: adf69efebc954db1aa7af7b93febbc2a1b51dc6c [57/57] libceph: define a structure to track SPARSE_READ reply processing
config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/20220211/202202111451.CXV1VUqM-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/commit/?id=adf69efebc954db1aa7af7b93febbc2a1b51dc6c
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 adf69efebc954db1aa7af7b93febbc2a1b51dc6c
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash net/ceph/

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

All warnings (new ones prefixed by >>):

>> net/ceph/messenger_v2.c:1783:37: warning: 'struct cepn_connection' declared inside parameter list will not be visible outside of this definition or declaration
1783 | static int prepare_read_data(struct cepn_connection *con)
| ^~~~~~~~~~~~~~~
net/ceph/messenger_v2.c: In function 'prepare_read_data':
net/ceph/messenger_v2.c:1787:5: error: dereferencing pointer to incomplete type 'struct cepn_connection'
1787 | con->in_data_crc = -1;
| ^~
net/ceph/messenger_v2.c:1788:30: error: passing argument 1 of 'prepare_read_data_len' from incompatible pointer type [-Werror=incompatible-pointer-types]
1788 | ret = prepare_read_data_len(con, data_len(con->in_msg));
| ^~~
| |
| struct cepn_connection *
net/ceph/messenger_v2.c:1759:58: note: expected 'struct ceph_connection *' but argument is of type 'struct cepn_connection *'
1759 | static int prepare_read_data_len(struct ceph_connection *con, int len)
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
net/ceph/messenger_v2.c: In function 'prepare_sparse_read_data_cont':
net/ceph/messenger_v2.c:1842:24: error: 'iter' undeclared (first use in this function)
1842 | if (!iov_iter_is_bvec(iter))
| ^~~~
net/ceph/messenger_v2.c:1842:24: note: each undeclared identifier is reported only once for each function it appears in
net/ceph/messenger_v2.c:1881:10: error: implicit declaration of function 'handle_epilogue'; did you mean 'decode_epilogue'? [-Werror=implicit-function-declaration]
1881 | return handle_epilogue(con);
| ^~~~~~~~~~~~~~~
| decode_epilogue
net/ceph/messenger_v2.c:1839:19: warning: unused variable 'in_iter' [-Wunused-variable]
1839 | struct iov_iter *in_iter = &con->v2.in_iter;
| ^~~~~~~
net/ceph/messenger_v2.c: In function 'prepare_sparse_read_header':
net/ceph/messenger_v2.c:1898:24: error: 'iter' undeclared (first use in this function)
1898 | if (!iov_iter_is_kvec(iter))
| ^~~~
net/ceph/messenger_v2.c:1895:19: warning: unused variable 'in_iter' [-Wunused-variable]
1895 | struct iov_iter *in_iter = &con->v2.in_iter;
| ^~~~~~~
net/ceph/messenger_v2.c:1893:17: warning: unused variable 'bv' [-Wunused-variable]
1893 | struct bio_vec bv;
| ^~
net/ceph/messenger_v2.c: In function 'prepare_read_tail_plain':
net/ceph/messenger_v2.c:1951:28: error: passing argument 1 of 'prepare_read_data' from incompatible pointer type [-Werror=incompatible-pointer-types]
1951 | return prepare_read_data(con);
| ^~~
| |
| struct ceph_connection *
net/ceph/messenger_v2.c:1783:54: note: expected 'struct cepn_connection *' but argument is of type 'struct ceph_connection *'
1783 | static int prepare_read_data(struct cepn_connection *con)
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
net/ceph/messenger_v2.c: At top level:
net/ceph/messenger_v2.c:2938:12: error: static declaration of 'handle_epilogue' follows non-static declaration
2938 | static int handle_epilogue(struct ceph_connection *con)
| ^~~~~~~~~~~~~~~
net/ceph/messenger_v2.c:1881:10: note: previous implicit declaration of 'handle_epilogue' was here
1881 | return handle_epilogue(con);
| ^~~~~~~~~~~~~~~
net/ceph/messenger_v2.c: In function 'populate_in_iter':
net/ceph/messenger_v2.c:3012:28: error: passing argument 1 of 'prepare_read_data' from incompatible pointer type [-Werror=incompatible-pointer-types]
3012 | ret = prepare_read_data(con);
| ^~~
| |
| struct ceph_connection *
net/ceph/messenger_v2.c:1783:54: note: expected 'struct cepn_connection *' but argument is of type 'struct ceph_connection *'
1783 | static int prepare_read_data(struct cepn_connection *con)
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~
net/ceph/messenger_v2.c:3014:8: error: 'IN_S_PREPARE_READ_SPARSE_DATA' undeclared (first use in this function); did you mean 'IN_S_PREPARE_SPARSE_DATA'?
3014 | case IN_S_PREPARE_READ_SPARSE_DATA:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| IN_S_PREPARE_SPARSE_DATA
At top level:
net/ceph/messenger_v2.c:1834:12: warning: 'prepare_sparse_read_data_cont' defined but not used [-Wunused-function]
1834 | static int prepare_sparse_read_data_cont(struct ceph_connection *con)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +1783 net/ceph/messenger_v2.c

1782
> 1783 static int prepare_read_data(struct cepn_connection *con)
1784 {
1785 int ret;
1786
1787 con->in_data_crc = -1;
1788 ret = prepare_read_data_len(con, data_len(con->in_msg));
1789 if (ret == 0)
1790 con->v2.in_state = IN_S_PREPARE_READ_DATA_CONT;
1791 return ret;
1792 }
1793

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