Skip to contentSkip to conversation

libtracefs: Pass enum value where expected instead of int

PATCH New Matt Turner 1 participant 1 message Aug 2, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Pass enum value where expected instead of int

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);
      |                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
---
 include/tracefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/tracefs.h +1 -1
index 269b119..90df00f 100644
@@ -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);
 }
 
 /**
Signature · 1 line
2.41.0