aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/scripts/unwcheck.py
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/scripts/unwcheck.py')
-rw-r--r--arch/ia64/scripts/unwcheck.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/ia64/scripts/unwcheck.py b/arch/ia64/scripts/unwcheck.py
index 89f3a1480a63..c55276e31b6b 100644
--- a/arch/ia64/scripts/unwcheck.py
+++ b/arch/ia64/scripts/unwcheck.py
@@ -16,7 +16,7 @@ import re
16import sys 16import sys
17 17
18if len(sys.argv) != 2: 18if len(sys.argv) != 2:
19 print "Usage: %s FILE" % sys.argv[0] 19 print("Usage: %s FILE" % sys.argv[0])
20 sys.exit(2) 20 sys.exit(2)
21 21
22readelf = os.getenv("READELF", "readelf") 22readelf = os.getenv("READELF", "readelf")
@@ -29,7 +29,7 @@ def check_func (func, slots, rlen_sum):
29 global num_errors 29 global num_errors
30 num_errors += 1 30 num_errors += 1
31 if not func: func = "[%#x-%#x]" % (start, end) 31 if not func: func = "[%#x-%#x]" % (start, end)
32 print "ERROR: %s: %lu slots, total region length = %lu" % (func, slots, rlen_sum) 32 print("ERROR: %s: %lu slots, total region length = %lu" % (func, slots, rlen_sum))
33 return 33 return
34 34
35num_funcs = 0 35num_funcs = 0
@@ -43,23 +43,23 @@ for line in os.popen("%s -u %s" % (readelf, sys.argv[1])):
43 check_func(func, slots, rlen_sum) 43 check_func(func, slots, rlen_sum)
44 44
45 func = m.group(1) 45 func = m.group(1)
46 start = long(m.group(2), 16) 46 start = int(m.group(2), 16)
47 end = long(m.group(3), 16) 47 end = int(m.group(3), 16)
48 slots = 3 * (end - start) / 16 48 slots = 3 * (end - start) / 16
49 rlen_sum = 0L 49 rlen_sum = 0
50 num_funcs += 1 50 num_funcs += 1
51 else: 51 else:
52 m = rlen_pattern.match(line) 52 m = rlen_pattern.match(line)
53 if m: 53 if m:
54 rlen_sum += long(m.group(1)) 54 rlen_sum += int(m.group(1))
55check_func(func, slots, rlen_sum) 55check_func(func, slots, rlen_sum)
56 56
57if num_errors == 0: 57if num_errors == 0:
58 print "No errors detected in %u functions." % num_funcs 58 print("No errors detected in %u functions." % num_funcs)
59else: 59else:
60 if num_errors > 1: 60 if num_errors > 1:
61 err="errors" 61 err="errors"
62 else: 62 else:
63 err="error" 63 err="error"
64 print "%u %s detected in %u functions." % (num_errors, err, num_funcs) 64 print("%u %s detected in %u functions." % (num_errors, err, num_funcs))
65 sys.exit(1) 65 sys.exit(1)