linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 1/4] libtracefs: Fix enable_disable_all() return value
Date: Tue,  8 Jun 2021 16:55:00 +0300	[thread overview]
Message-ID: <20210608135503.12135-1-y.karadz@gmail.com> (raw)

enable_disable_all() is a static method used internally by the
tracefs_event_enable/disable() API. In some cases its return
value gets propagated as a return of the API function but this
value do not obey the description given in the documentation.

Fixes: fc94d1a (libtracefs: Add tracefs_event_enable/disable() API)
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/tracefs-events.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tracefs-events.c b/src/tracefs-events.c
index 55316c6..8b2d9ef 100644
--- a/src/tracefs-events.c
+++ b/src/tracefs-events.c
@@ -822,8 +822,10 @@ static int enable_disable_all(struct tracefs_instance *instance,
 			      bool enable)
 {
 	const char *str = enable ? "1" : "0";
+	int ret;
 
-	return tracefs_instance_file_write(instance, "events/enable", str);
+	ret = tracefs_instance_file_write(instance, "events/enable", str);
+	return ret < 0 ? ret : 0;
 }
 
 static int event_enable_disable(struct tracefs_instance *instance,
-- 
2.27.0


             reply	other threads:[~2021-06-08 13:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 13:55 Yordan Karadzhov (VMware) [this message]
2021-06-08 13:55 ` [PATCH 2/4] libtracefs: Fix event_enable_disable() " Yordan Karadzhov (VMware)
2021-06-08 13:55 ` [PATCH 3/4] libtracefs: Fix typo in function name Yordan Karadzhov (VMware)
2021-06-08 13:55 ` [PATCH 4/4] libtracefs: Propagate the return value of the callback function Yordan Karadzhov (VMware)
2021-06-09 17:00   ` Steven Rostedt
2021-06-11 11:03     ` Yordan Karadzhov (VMware)

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=20210608135503.12135-1-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --subject='Re: [PATCH 1/4] libtracefs: Fix enable_disable_all() return value' \
    /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

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).