perf tools: Fix unwind build on i386
authorBen Hutchings <ben@decadent.org.uk>
Sat, 22 Jul 2017 16:37:33 +0000 (17:37 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 19 Apr 2018 10:13:03 +0000 (11:13 +0100)
EINVAL may not be defined when building unwind-libunwind.c with
REMOTE_UNWIND_LIBUNWIND, resulting in a compiler error in
LIBUNWIND__ARCH_REG_ID().  Its only caller, access_reg(), only checks
for a negative return value and doesn't care what it is.  So change
-EINVAL to -1.

Fixes: 52ffe0ff02fc ("Support x86(32-bit) cross platform callchain unwind.")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name perf-tools-fix-unwind-build-on-i386.patch

tools/perf/arch/x86/util/unwind-libunwind.c

index 9c917f80c90653a49e248073c2b6d1fb64e1b620..5565415fc79db83dae2bc4bda020b3d4a71d7e4f 100644 (file)
@@ -67,7 +67,7 @@ int LIBUNWIND__ARCH_REG_ID(int regnum)
                break;
        default:
                pr_err("unwind: invalid reg id %d\n", regnum);
-               return -EINVAL;
+               return -1;
        }
 
        return id;
@@ -107,7 +107,7 @@ int LIBUNWIND__ARCH_REG_ID(int regnum)
                break;
        default:
                pr_err("unwind: invalid reg id %d\n", regnum);
-               return -EINVAL;
+               return -1;
        }
 
        return id;