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]
Message-ID: <2024030713-favorably-liking-2135@gregkh>
Date: Thu, 7 Mar 2024 22:04:41 +0000
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sysfs: make sysfs_emit() return ssize_t

On Mon, Feb 05, 2024 at 01:11:36PM +0300, Alexey Dobriyan wrote:
> sysfs_emit() is most often found in functions returning ssize_t
> not int:
> 
> 	static ssize_t oops_count_show(...)
> 	{
> 		return sysfs_emit(page, ...);
> 	}
> 
> This pattern results in sign-extension instruction between
> sysfs_emit() return value (int) and caller return value (which is
> ssize_t).

Is that a problem?

> But it is better to do sign-extension once inside sysfs_emit()
> then duplicate it at nearly every call site on 64-bit.

Why is that better?  Does this affect code generation?  If so, how much?
And to what affect?

And the function itself really is dealing with an int, it's up to the
caller to want to do something with that, not the sysfs_emit() call
itself.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ