[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The perf_event_open code parses some files under /sys
There are some hex values there, traditionally these were all lowercase
but on RaspberryPi2 machines for whatever reason they use uppercase.
    
This led to warnings like this:
    
    Unexpected char A
    Unexpected char D
    Unexpected char D
    Unexpected char B

Signed-off-by: Vince Weaver <vincent.weaver@xxxxxxxxx>

diff --git a/syscalls/perf_event_open.c b/syscalls/perf_event_open.c
index dd434bb..e299765 100644
--- a/syscalls/perf_event_open.c
+++ b/syscalls/perf_event_open.c
@@ -245,16 +245,20 @@ static int parse_generic(int pmu, const char *value,
 				if (value[ptr]==0) break;
 				if (value[ptr]==',') break;
 				if (! ( ((value[ptr]>='0') && (value[ptr]<='9'))
-                   			|| ((value[ptr]>='a') && (value[ptr]<='f'))) ) {
+					|| ((value[ptr]>='a') && (value[ptr]<='f'))
+					|| ((value[ptr]>='A') && (value[ptr]<='F'))) ) {
 					outputerr("Unexpected char %c\n", value[ptr]);
 				}
 				temp*=base;
 				if ((value[ptr]>='0') && (value[ptr]<='9')) {
 					temp+=value[ptr]-'0';
 				}
-				else {
+				else if ((value[ptr]>='a') && (value[ptr]<='f')) {
 					temp+=(value[ptr]-'a')+10;
 				}
+				else {
+					temp+=(value[ptr]-'A')+10;
+				}
 				i++;
 				ptr++;
 			}
--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux