Skip to content

Commit 8f67f65

Browse files
Yihao HanVineet Gupta
authored andcommitted
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 <hanyihao@vivo.com> Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
1 parent ca295ff commit 8f67f65

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

arch/arc/kernel/unwind.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,9 @@ static void swap_eh_frame_hdr_table_entries(void *p1, void *p2, int size)
245245
{
246246
struct eh_frame_hdr_table_entry *e1 = p1;
247247
struct eh_frame_hdr_table_entry *e2 = p2;
248-
unsigned long v;
249-
250-
v = e1->start;
251-
e1->start = e2->start;
252-
e2->start = v;
253-
v = e1->fde;
254-
e1->fde = e2->fde;
255-
e2->fde = v;
248+
249+
swap(e1->start, e2->start);
250+
swap(e1->fde, e2->fde);
256251
}
257252

258253
static void init_unwind_hdr(struct unwind_table *table,

0 commit comments

Comments
 (0)