arc: use swap() to make code cleaner
PATCH 1/1 arc: use swap() to make code cleaner
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it.
Signed-off-by Yihao Han <[email protected]>
--- arch/arc/kernel/unwind.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
arch/arc/kernel/unwind.c +3 -8
@@ -245,14 +245,9 @@ static void swap_eh_frame_hdr_table_entries(void *p1, void *p2, int size) {struct eh_frame_hdr_table_entry *e1 = p1;struct eh_frame_hdr_table_entry *e2 = p2; -unsigned long v; - - v = e1->start; - e1->start = e2->start; - e2->start = v; - v = e1->fde; - e1->fde = e2->fde; - e2->fde = v; + +swap (e1->start, e2->start); +swap (e1->fde, e2->fde); } static void init_unwind_hdr(struct unwind_table *table,
Signature · 1 line
2.17.1
Vineet Gupta
maintainerQuoted 4 lines · Yihao Han
Use the macro '
swap()' defined in 'include/linux/minmax.h' to avoid opencoding it.Signed-off-by Yihao Han<[email protected]>
Added to ARC tree.
Thx,
-Vineet