* [PATCH] libtracefs: Pass enum value where expected instead of int
@ 2023-08-02 15:40 Matt Turner
0 siblings, 0 replies; only message in thread
From: Matt Turner @ 2023-08-02 15:40 UTC (permalink / raw)
To: linux-trace-devel; +Cc: Matt Turner
Avoids warnings in C++ consumers (such as powertop).
In file included from perf/perf.h:32,
from main.cpp:46:
/usr/include/libtracefs/tracefs.h: In function ‘int tracefs_hist_start(tracefs_instance*, tracefs_hist*)’:
/usr/include/libtracefs/tracefs.h:456:53: warning: invalid conversion from ‘int’ to ‘tracefs_hist_command’ [-fpermissive]
456 | return tracefs_hist_command(instance, hist, 0);
| ^
| |
| int
/usr/include/libtracefs/tracefs.h:442:79: note: initializing argument 3 of ‘int tracefs_hist_command(tracefs_instance*, tracefs_hist*, tracefs_hist_command)’
442 | struct tracefs_hist *hist, enum tracefs_hist_command cmd);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
include/tracefs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/tracefs.h b/include/tracefs.h
index 269b119..90df00f 100644
--- a/include/tracefs.h
+++ b/include/tracefs.h
@@ -453,7 +453,7 @@ int tracefs_hist_command(struct tracefs_instance *instance,
static inline int tracefs_hist_start(struct tracefs_instance *instance,
struct tracefs_hist *hist)
{
- return tracefs_hist_command(instance, hist, 0);
+ return tracefs_hist_command(instance, hist, TRACEFS_HIST_CMD_START);
}
/**
--
2.41.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-02 15:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 15:40 [PATCH] libtracefs: Pass enum value where expected instead of int Matt Turner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).