Skip to content

Commit

Permalink
arc: use swap() to make code cleaner
Browse files Browse the repository at this point in the history
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Signed-off-by: Yihao Han <hanyihao@vivo.com>
Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
  • Loading branch information
Yihao Han authored and Vineet Gupta committed Dec 29, 2021
1 parent ca295ff commit 8f67f65
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions arch/arc/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8f67f65

Please sign in to comment.