Skip to content

Commit

Permalink
ia64: module: 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.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Yang Guang <[email protected]>
Reported-by: Zeal Robot <[email protected]>
Cc: David Yang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Yang Guang authored and torvalds committed Jan 15, 2022
1 parent ff78f66 commit f2fed02
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/ia64/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ register_unwind_table (struct module *mod)
{
struct unw_table_entry *start = (void *) mod->arch.unwind->sh_addr;
struct unw_table_entry *end = start + mod->arch.unwind->sh_size / sizeof (*start);
struct unw_table_entry tmp, *e1, *e2, *core, *init;
struct unw_table_entry *e1, *e2, *core, *init;
unsigned long num_init = 0, num_core = 0;

/* First, count how many init and core unwind-table entries there are. */
Expand All @@ -865,9 +865,7 @@ register_unwind_table (struct module *mod)
for (e1 = start; e1 < end; ++e1) {
for (e2 = e1 + 1; e2 < end; ++e2) {
if (e2->start_offset < e1->start_offset) {
tmp = *e1;
*e1 = *e2;
*e2 = tmp;
swap(*e1, *e2);
}
}
}
Expand Down

0 comments on commit f2fed02

Please sign in to comment.