summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>2013-03-29 12:14:43 -0700
committerChanho Park <chanho61.park@samsung.com>2014-08-08 14:35:30 +0900
commit617e3369b2e3db0a2bd4d0ce22c97a0d1b69299a (patch)
treeea3efc978f777caaebb2b3c6eb3f9d8077238ec7
parent0393203d8abeefd0067ae196afa2511c52319a3e (diff)
downloadlinux-3.10-617e3369b2e3db0a2bd4d0ce22c97a0d1b69299a.tar.gz
linux-3.10-617e3369b2e3db0a2bd4d0ce22c97a0d1b69299a.tar.bz2
linux-3.10-617e3369b2e3db0a2bd4d0ce22c97a0d1b69299a.zip
perf tools: Fix bug in isupper() and islower()
One of the reasons 'perf test' is failing on Power appears to be due to a bug in isupper(). isupper(c) and islower(c) should be checking 'c' against the mask 0x20. Instead they are checking sane_ctype[c] which causes isupper() to be true for lower case letters. Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20130329192950.GA9312@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index a45710b70a5..7a484c97e50 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -221,8 +221,8 @@ extern unsigned char sane_ctype[256];
#define isalpha(x) sane_istest(x,GIT_ALPHA)
#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
#define isprint(x) sane_istest(x,GIT_PRINT)
-#define islower(x) (sane_istest(x,GIT_ALPHA) && sane_istest(x,0x20))
-#define isupper(x) (sane_istest(x,GIT_ALPHA) && !sane_istest(x,0x20))
+#define islower(x) (sane_istest(x,GIT_ALPHA) && (x & 0x20))
+#define isupper(x) (sane_istest(x,GIT_ALPHA) && !(x & 0x20))
#define tolower(x) sane_case((unsigned char)(x), 0x20)
#define toupper(x) sane_case((unsigned char)(x), 0)