From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/5] tools/perf,tools/lib/traceevent: Make traceevent APIs more consistent
Date: Wed, 27 Mar 2019 10:41:49 -0400 [thread overview]
Message-ID: <20190327104149.17319833@gandalf.local.home> (raw)
In-Reply-To: <20190327141946.4353-2-tstoyanov@vmware.com>
On Wed, 27 Mar 2019 16:19:42 +0200
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:
> /**
> - * tep_file_bigendian - get if the file is in big endian order
> + * tep_is_file_bigendian - return the endian of the file
> * @pevent: a handle to the tep_handle
> *
> - * This returns if the file is in big endian order
> - * If @pevent is NULL, 0 is returned.
> + * This returns true if the file is in big endian order
> + * If @pevent is NULL, false is returned.
> */
> -int tep_file_bigendian(struct tep_handle *pevent)
> +bool tep_is_file_bigendian(struct tep_handle *pevent)
> {
> if (pevent)
> - return pevent->file_bigendian;
> - return 0;
> + return (pevent->file_bigendian == TEP_BIG_ENDIAN);
One thing I should have mentioned before, is that, when people write
returns like this to the Linux kernel mailing list, you might get a
comment like: "return is not a function, lose the parenthesis".
That is, it should be:
return pevent->file_bigendian == TEP_BIG_ENDIAN;
not
return (pevent->file_bigendian == TEP_BIG_ENDIAN);
If this is the only issue, I may just fix it myself. Just remember that
returns should never have an outside parenthesis.
-- Steve
> + return false;
> }
>
next prev parent reply other threads:[~2019-03-27 14:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-27 14:19 [PATCH v2 0/5] Cleanup traceevent API and make it more consistent Tzvetomir Stoyanov
2019-03-27 14:19 ` [PATCH v2 1/5] tools/perf,tools/lib/traceevent: Make traceevent APIs " Tzvetomir Stoyanov
2019-03-27 14:41 ` Steven Rostedt [this message]
2019-03-27 14:19 ` [PATCH v2 2/5] tools/lib/traceevent: Rename input arguments of libtraceevent APIs from pevent to tep Tzvetomir Stoyanov
2019-03-27 15:06 ` Steven Rostedt
2019-03-27 14:19 ` [PATCH v2 3/5] tools/perf,tools/lib/traceevent: Rename "pevent" member of struct tep_event to "tep" Tzvetomir Stoyanov
2019-03-27 14:19 ` [PATCH v2 4/5] tools/perf,tools/lib/traceevent: Rename "pevent" member of struct tep_event_filter " Tzvetomir Stoyanov
2019-03-27 14:19 ` [PATCH v2 5/5] tools/lib/traceevent: Rename input arguments and local variables of libtraceevent from pevent to tep Tzvetomir Stoyanov
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=20190327104149.17319833@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tstoyanov@vmware.com \
/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 NNTP newsgroup(s).