Whamcloud - gitweb
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>