Skip to contentSkip to conversation

UBIFS: use swap macro in swap_dirty_idx

PATCH New Gustavo A. R. Silva 1 participant 1 message Jul 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBIFS: use swap macro in swap_dirty_idx

Make use of the swap macro and remove unnecessary variable *t*. This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

---
 fs/ubifs/find.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/ubifs/find.c +1 -4
index 9571616..36198f8 100644
@@ -750,10 +750,7 @@ static int cmp_dirty_idx(const struct ubifs_lprops **a,
 static void swap_dirty_idx(struct ubifs_lprops **a, struct ubifs_lprops **b,
 			   int size)
 {
-	struct ubifs_lprops *t = *a;
-
-	*a = *b;
-	*b = t;
+	swap(*a, *b);
 }
 
 /**
Signature · 1 line
2.7.4