scripts/sorttable: Unify arm64 & x86 sort functions
authorMark Rutland <mark.rutland@arm.com>
Mon, 8 Nov 2021 11:42:20 +0000 (11:42 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 5 Jan 2022 18:06:26 +0000 (10:06 -0800)
commite232333be69ee9ccd4281032af0d2416940cb98d
tree54d3becb19288292ee27d69ba4ba6ef4a2341196
parentfa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
scripts/sorttable: Unify arm64 & x86 sort functions

The format of the arm64 and x86 exception table entries is essentially
the same as of commits:

  46d28947d9876fc0 ("x86/extable: Rework the exception table mechanics")
  d6e2cc5647753825 ("arm64: extable: add `type` and `data` fields")

Both use a 12-byte entry consisting of two 32-bit relative offsets and
32 bits of (absolute) data, and their sort functions are identical aside
from commentary, with arm64 saying:

   /* Don't touch the fixup type or data */

... and x86 saying:

  /* Don't touch the fixup type */

Unify the two behind a common sort_relative_table_with_data() function,
retaining the arm64 commentary.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
scripts/sorttable.c