Whamcloud - gitweb
LU-12764 lnet: eliminate uninitialized warning 89/36189/2
authorWang Shilong <wshilong@ddn.com>
Mon, 16 Sep 2019 01:55:58 +0000 (18:55 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Oct 2019 03:44:50 +0000 (03:44 +0000)
commita8fbaa1b998f558cdb196822447b2aafe8cf98b5
treed1dd436ef7d09922d80d46b248e0fd3232811a0a
parent6d0e247cfc956dae1148aad054bb3d100c8863c9
LU-12764 lnet: eliminate uninitialized warning

lustre-release/lnet/lnet/router.c: In function ‘lnet_del_route’:
include/linux/compiler.h:177:26: error: ‘lp’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
  case 8: *(__u64 *)res = *(volatile __u64 *)p; break;  \
                          ^
/home/wangsl/lustre-release/lnet/lnet/router.c:754:20: note: ‘lp’ was declared here
  struct lnet_peer *lp;
                    ^
/home/wangsl/lustre-release/lnet/lnet/router.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-stringop-overflow’ [-Werror]
cc1: error: unrecognized command line option ‘-Wno-stringop-truncation’ [-Werror]
cc1: error: unrecognized command line option ‘-Wno-format-truncation’ [-Werror]
cc1: all warnings being treated as errors

codes logic gurantee @lpi and @lpni are inited at the same time,
but let's init @lpi to make gcc happy.

Change-Id: I1ccd88ca5061b5f29a530bf2b755585c92612a69
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/36189
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/router.c