diff mbox series

libtracefs: Pass enum value where expected instead of int

Message ID 20230802154054.1828136-1-mattst88@gmail.com (mailing list archive)
State Accepted
Commit 07ab1995953dcec8bf45a65bded4ca2d4781cf16
Headers show
Series libtracefs: Pass enum value where expected instead of int | expand

Commit Message

Matt Turner Aug. 2, 2023, 3:40 p.m. UTC
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 mbox series

Patch

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);
 }
 
 /**