[PATCH] libtracefs: Pass enum value where expected instead of int

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

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux