scripts/sortextable: Rewrite error/success handling
authorShile Zhang <shile.zhang@linux.alibaba.com>
Wed, 4 Dec 2019 00:46:27 +0000 (08:46 +0800)
committerIngo Molnar <mingo@kernel.org>
Fri, 13 Dec 2019 09:47:31 +0000 (10:47 +0100)
commit3c47b787b6516d2c3cbaa193fe13a83adbaaad1f
treedfee893f535e2b249c88229d28a79afec7e25452
parent37d4e84f765bb3038ddfeebdc5d1cfd7e1ef688f
scripts/sortextable: Rewrite error/success handling

The scripts/sortextable.c code has originally copied some code from
scripts/recordmount.c, which used the same setjmp/longjmp method to
manage control flow.

Meanwhile recordmcount has improved its error handling via:

   3f1df12019f3 ("recordmcount: Rewrite error/success handling").

So rewrite this part of sortextable as well to get rid of the setjmp/longjmp
kludges, with additional refactoring, to make it more readable and
easier to extend.

No functional changes intended.

[ mingo: Rewrote the changelog. ]

Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: linux-kbuild@vger.kernel.org
Link: https://lkml.kernel.org/r/20191204004633.88660-2-shile.zhang@linux.alibaba.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
scripts/sortextable.c
scripts/sortextable.h