Whamcloud - gitweb
LU-6142 lnet: code style cleanups, improve error handling 69/18469/5
authorJames Simmons <uja.ornl@yahoo.com>
Tue, 10 Jan 2017 23:11:34 +0000 (18:11 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 24 Jan 2017 05:20:26 +0000 (05:20 +0000)
commit40ae5dd2f2d0c6abe8e2f83ab9652873bee92485
treefcb778dffb18fe2a61a5db3b299885ac0f14f49d
parent9407629a816feff9f773517f90b615164319642f
LU-6142 lnet: code style cleanups, improve error handling

During submission of the dynamic LNet work to the upstream
client Dan Carpenter suggested several improvements and a
few fixes. They are:

1) Rename the goto labels to be more clear.

2) Replace CLASSERT with BUILD_BUG_ON

3) Rework the loops to reduce the code indentation level
   and to make them more clear.

4) Add test to ensure the ioctl data is really smaller
   than what is reported in the ioctl header.

5) Fix one off error in lnet_get_peer_info

6) Handle errors instead of sucesses in lnet_dyn_[un]configure

Change-Id: If003d313ae587fd6311d9dfb419e8c6f59ef4705
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/18469
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/lnet/api-ni.c
lnet/lnet/module.c
lnet/lnet/peer.c
lnet/lnet/router.c