lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 Mar 2019 10:41:49 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Tzvetomir Stoyanov <tstoyanov@...are.com>
Cc:     linux-trace-devel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/5] tools/perf,tools/lib/traceevent: Make traceevent
 APIs more consistent

On Wed, 27 Mar 2019 16:19:42 +0200
Tzvetomir Stoyanov <tstoyanov@...are.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;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ