Skip to contentSkip to conversation

perf loongarch: Fix discarded-qualifiers warning in _get_field()

PATCH In review WANG Rui 2 participants 2 messages Apr 14

Subsystems (2)
lore
Share & tools
lore

WANG Rui

author
#0 lore raw

PATCH 1/1 perf loongarch: Fix discarded-qualifiers warning in _get_field()

From: Haiyong Sun <[email protected]>

arch/loongarch/util/header.c: In function ‘_get_field’:
arch/loongarch/util/header.c:31:15: warning: assignment discards ‘const’ qualifier from pointer target type arch/loongarch/util/header.c:36:12: warning: assignment discards ‘const’ qualifier from pointer target type

---
 tools/perf/arch/loongarch/util/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/loongarch/util/header.c +1 -1
index 0c6d82333..46f53a74f 100644
@@ -26,7 +26,7 @@
 
 static char *_get_field(const char *line)
 {
-	char *line2, *nl;
+	const char *line2, *nl;
 
 	line2 = strrchr(line, ' ');
 	if (!line2)
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · WANG Rui

From: Haiyong Sun <[email protected]>

arch/loongarch/util/header.c: In function ‘_get_field’:
arch/loongarch/util/header.c:31:15: warning: assignment discards ‘const’ qualifier from pointer target type arch/loongarch/util/header.c:36:12: warning: assignment discards ‘const’ qualifier from pointer target type

Quoted 21 lines
---
 tools/perf/arch/loongarch/util/header.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/loongarch/util/header.c +1 -2
index 0c6d82333..46f53a74f 100644
@@ -26,7 +26,7 @@
 
 static char *_get_field(const char *line)
 {
-       char *line2, *nl;
+       const char *line2, *nl;
 
        line2 = strrchr(line, ' ');
        if (!line2)
--

2.53.0