Subject: linux-next: manual merge of the ftrace tree with Linus' tree

From: Stephen Rothwell <[email-masked]>
Date: Wed, 8 Jan 2025 13:32:07 +1100

Hi all,

Today's linux-next merge of the ftrace tree got a conflict in:

  scripts/sorttable.h

between commit:

  0210d251162f ("scripts/sorttable: fix orc_sort_cmp() to maintain symmetry and transitivity")

from Linus' tree and commit:

  4f1d0c914628 ("scripts/sorttable: Move code from sorttable.h into sorttable.c")

from the ftrace tree.

I fixed it up (I deleted the file and applied the following merge fix
patch) and can carry the fix as necessary. This is now fixed as far as
linux-next is concerned, but any non trivial conflicts should be mentioned
to your upstream maintainer when your tree is submitted for merging.
You may also want to consider cooperating with the maintainer of the
conflicting tree to minimise any particularly complex conflicts.

From: Stephen Rothwell <[email-masked]>
Date: Wed, 8 Jan 2025 13:23:17 +1100
Subject: [PATCH] fix up for "scripts/sorttable: Move code from sorttable.h
 into sorttable.c"

interacting with commit

  0210d251162f ("scripts/sorttable: fix orc_sort_cmp() to maintain symmetry and transitivity")

from Linus' tree.

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 scripts/sorttable.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/sorttable.c b/scripts/sorttable.c
index cd3b2145a827..656c1e9b5ad9 100644
--- a/scripts/sorttable.c
+++ b/scripts/sorttable.c
@@ -368,7 +368,7 @@ static inline unsigned long orc_ip(const int *ip)
 
 static int orc_sort_cmp(const void *_a, const void *_b)
 {
-	struct orc_entry *orc_a;
+	struct orc_entry *orc_a, *orc_b;
 	const int *a = g_orc_ip_table + *(int *)_a;
 	const int *b = g_orc_ip_table + *(int *)_b;
 	unsigned long a_val = orc_ip(a);
@@ -386,6 +386,9 @@ static int orc_sort_cmp(const void *_a, const void *_b)
 	 * whitelisted .o files which didn't get objtool generation.
 	 */
 	orc_a = g_orc_table + (a - g_orc_ip_table);
+	orc_b = g_orc_table + (b - g_orc_ip_table);
+	if (orc_a->type == ORC_TYPE_UNDEFINED && orc_b->type == ORC_TYPE_UNDEFINED)
+		return 0;
 	return orc_a->type == ORC_TYPE_UNDEFINED ? -1 : 1;
 }
 
-- 
2.45.2

-- 
Cheers,
Stephen Rothwell