[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201806252254.7c4hOURv%fengguang.wu@intel.com>
Date: Mon, 25 Jun 2018 22:52:21 +0800
From: kbuild test robot <lkp@...el.com>
To: Ka-Cheong Poon <ka-cheong.poon@...cle.com>
Cc: kbuild-all@...org, netdev@...r.kernel.org,
santosh.shilimkar@...cle.com, davem@...emloft.net,
rds-devel@....oracle.com
Subject: Re: [PATCH net-next 2/3] rds: Enable RDS IPv6 support
Hi Ka-Cheong,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Ka-Cheong-Poon/rds-IPv6-support/20180625-190047
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
net/rds/tcp_listen.c:86:22: sparse: expression using sizeof(void)
>> net/rds/tcp_listen.c:288:33: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] sin6_port @@ got unsignedrestricted __be16 [usertype] sin6_port @@
net/rds/tcp_listen.c:288:33: expected restricted __be16 [usertype] sin6_port
net/rds/tcp_listen.c:288:33: got unsigned short [unsigned] [usertype] <noident>
>> net/rds/tcp_listen.c:295:38: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] s_addr @@ got ricted __be32 [usertype] s_addr @@
net/rds/tcp_listen.c:295:38: expected restricted __be32 [usertype] s_addr
net/rds/tcp_listen.c:295:38: got unsigned long [unsigned] <noident>
>> net/rds/tcp_listen.c:296:31: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] sin_port @@ got unsignedrestricted __be16 [usertype] sin_port @@
net/rds/tcp_listen.c:296:31: expected restricted __be16 [usertype] sin_port
net/rds/tcp_listen.c:296:31: got unsigned short [unsigned] [usertype] <noident>
vim +288 net/rds/tcp_listen.c
258
259 struct socket *rds_tcp_listen_init(struct net *net, bool isv6)
260 {
261 struct socket *sock = NULL;
262 struct sockaddr_storage ss;
263 struct sockaddr_in6 *sin6;
264 struct sockaddr_in *sin;
265 int addr_len;
266 int ret;
267
268 ret = sock_create_kern(net, isv6 ? PF_INET6 : PF_INET, SOCK_STREAM,
269 IPPROTO_TCP, &sock);
270 if (ret < 0) {
271 rdsdebug("could not create %s listener socket: %d\n",
272 isv6 ? "IPv6" : "IPv4", ret);
273 goto out;
274 }
275
276 sock->sk->sk_reuse = SK_CAN_REUSE;
277 rds_tcp_nonagle(sock);
278
279 write_lock_bh(&sock->sk->sk_callback_lock);
280 sock->sk->sk_user_data = sock->sk->sk_data_ready;
281 sock->sk->sk_data_ready = rds_tcp_listen_data_ready;
282 write_unlock_bh(&sock->sk->sk_callback_lock);
283
284 if (isv6) {
285 sin6 = (struct sockaddr_in6 *)&ss;
286 sin6->sin6_family = PF_INET6;
287 sin6->sin6_addr = in6addr_any;
> 288 sin6->sin6_port = (__force u16)htons(RDS_TCP_PORT);
289 sin6->sin6_scope_id = 0;
290 sin6->sin6_flowinfo = 0;
291 addr_len = sizeof(*sin6);
292 } else {
293 sin = (struct sockaddr_in *)&ss;
294 sin->sin_family = PF_INET;
> 295 sin->sin_addr.s_addr = INADDR_ANY;
> 296 sin->sin_port = (__force u16)htons(RDS_TCP_PORT);
297 addr_len = sizeof(*sin);
298 }
299
300 ret = sock->ops->bind(sock, (struct sockaddr *)&ss, addr_len);
301 if (ret < 0) {
302 rdsdebug("could not bind %s listener socket: %d\n",
303 isv6 ? "IPv6" : "IPv4", ret);
304 goto out;
305 }
306
307 ret = sock->ops->listen(sock, 64);
308 if (ret < 0)
309 goto out;
310
311 return sock;
312 out:
313 if (sock)
314 sock_release(sock);
315 return NULL;
316 }
317
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Powered by blists - more mailing lists