From: Sukadev Bhattiprolu Date: Fri, 29 Mar 2013 19:14:43 +0000 (-0700) Subject: perf tools: Fix bug in isupper() and islower() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6956664a5c4c32d5aa48fe96d5e2421a3e3f72d5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Namhyung Kim Link: http://lkml.kernel.org/r/20130329192950.GA9312@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index a45710b70a55..7a484c97e500 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)