Skip to contentSkip to conversation

staging: lustre: libcfs: Use swap() and do

PATCH New Amitoj Kaur Chawla 1 participant 1 message Feb 23, 2016

lore
Share & tools
lore
#0 lore raw

v2 cover staging: lustre: libcfs: Use swap() and do

some cleanups
Message-ID: <[email protected]> Reply-To:

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>

Additionally, cleanup if-else statement block.

Amitoj Kaur Chawla (3):
staging: lustre: libcfs: Use swap() in cfs_hash_bd_order()
staging: lustre: libcfs: Remove unnecessary braces
staging: lustre: libcfs: Remove comparison with zero

Changes in v2:
-Divide one patch into a series.

 drivers/staging/lustre/lustre/libcfs/hash.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
Signature · 1 line
1.9.1