[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-6956664a5c4c32d5aa48fe96d5e2421a3e3f72d5@git.kernel.org>
Date: Fri, 31 May 2013 04:12:38 -0700
From: tip-bot for Sukadev Bhattiprolu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, hpa@...or.com,
mingo@...nel.org, sukadev@...ux.vnet.ibm.com, tglx@...utronix.de,
namhyung@...nel.org
Subject: [tip:perf/core] perf tools: Fix bug in isupper() and islower()
Commit-ID: 6956664a5c4c32d5aa48fe96d5e2421a3e3f72d5
Gitweb: http://git.kernel.org/tip/6956664a5c4c32d5aa48fe96d5e2421a3e3f72d5
Author: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
AuthorDate: Fri, 29 Mar 2013 12:14:43 -0700
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 28 May 2013 16:23:51 +0300
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@...ux.vnet.ibm.com>
Acked-by: Namhyung Kim <namhyung@...nel.org>
Link: http://lkml.kernel.org/r/20130329192950.GA9312@us.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/util.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index a45710b..7a484c9 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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists