diff mbox series

[03/10] tools lib traceevent: Removed unneeded !! and return parenthesis

Message ID 20190405140332.10949-4-tstoyanov@vmware.com (mailing list archive)
State Superseded
Headers show
Series Backport of traceevent APIs cleanup changes from kernel tree to trace-cmd | expand

Commit Message

Tzvetomir Stoyanov April 5, 2019, 2:03 p.m. UTC
From: Steven Rostedt (VMware) <rostedt@goodmis.org>

As return is not a function we do not need parenthesis around the return
value. Also, a function returning bool does not need to add !!.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Link: https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flkml.kernel.org%2Fr%2F20190401164343.817886725%40goodmis.org&amp;data=02%7C01%7Ctstoyanov%40vmware.com%7C420f58a3ff864e3d93b408d6b7853daf%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636898180235384820&amp;sdata=PTx4BKspBlUxHIPfzZRf2Rj5J8LmfzXxdCIXKdDUtoA%3D&amp;reserved=0
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 lib/traceevent/event-parse-api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Steven Rostedt April 5, 2019, 2:31 p.m. UTC | #1
On Fri,  5 Apr 2019 17:03:25 +0300
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> From: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 
> As return is not a function we do not need parenthesis around the return
> value. Also, a function returning bool does not need to add !!.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
> Link: https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flkml.kernel.org%2Fr%2F20190401164343.817886725%40goodmis.org&amp;data=02%7C01%7Ctstoyanov%40vmware.com%7C420f58a3ff864e3d93b408d6b7853daf%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636898180235384820&amp;sdata=PTx4BKspBlUxHIPfzZRf2Rj5J8LmfzXxdCIXKdDUtoA%3D&amp;reserved=0

Hmm, this isn't acceptable for upstream.

-- Steve


> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff mbox series

Patch

diff --git a/lib/traceevent/event-parse-api.c b/lib/traceevent/event-parse-api.c
index f2e5d18..fb49d1b 100644
--- a/lib/traceevent/event-parse-api.c
+++ b/lib/traceevent/event-parse-api.c
@@ -88,7 +88,7 @@  void tep_clear_flag(struct tep_handle *tep, enum tep_flag flag)
 bool tep_test_flag(struct tep_handle *tep, enum tep_flag flag)
 {
 	if (tep)
-		return (tep->flags & flag);
+		return tep->flags & flag;
 	return false;
 }
 
@@ -367,7 +367,7 @@  int tep_get_parsing_failures(struct tep_handle *tep)
 bool tep_is_old_format(struct tep_handle *tep)
 {
 	if (tep)
-		return !!(tep->old_format);
+		return tep->old_format;
 	return false;
 }