Linux-Trace-Devel Archive mirror
 help / color / mirror / Atom feed
From: Matt Turner <mattst88@gmail.com>
To: linux-trace-devel@vger.kernel.org
Cc: Matt Turner <mattst88@gmail.com>
Subject: [PATCH] libtracefs: Pass enum value where expected instead of int
Date: Wed,  2 Aug 2023 11:40:54 -0400	[thread overview]
Message-ID: <20230802154054.1828136-1-mattst88@gmail.com> (raw)

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


                 reply	other threads:[~2023-08-02 15:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230802154054.1828136-1-mattst88@gmail.com \
    --to=mattst88@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).