Whamcloud - gitweb
LU-4423 libcfs: Use swap() in cfs_hash_bd_order() 76/24576/2
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Mon, 2 Jan 2017 00:19:16 +0000 (19:19 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 24 Jan 2017 05:23:27 +0000 (05:23 +0000)
commit8a13ffb4a1eafff18cb891fdc812afaf09136f29
tree5f70c9e1b7ff4cfcfde622885f709ce316fad2d7
parent0eb8208e199c90f25368b3b0c25858248f874ccd
LU-4423 libcfs: Use swap() in cfs_hash_bd_order()

Use swap() function instead of using a temporary variable for swapping
two variables.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@@
type T;
T a,b,c;
@@
- a = b;
- b = c;
- c = a;
+ swap(b, c);
//<smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Change-Id: I19aa52fe4e05fed2e03c1d8515731a5ce01b3d09
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/24576
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
libcfs/libcfs/hash.c