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:	Thu, 24 Mar 2011 11:52:36 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Michal Nazarewicz <mnazarewicz@...gle.com>
cc:	Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Chris Wright <chrisw@...s-sol.org>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	Michal Nazarewicz <mina86@...a86.com>
Subject: Re: [PATCH] usb: core: Change usb_create_sysfs_intf_files()' return
 type to void

On Thu, 24 Mar 2011, Michal Nazarewicz wrote:

> From: Michal Nazarewicz <mina86@...a86.com>
> 
> The usb_create_sysfs_intf_files() function always returned zero even
> if it failed to create sysfs fails.  Since this is a desired behaviour
> there is no need to return return code at all.  This commit changes
> function's return type (form int) to void.
> 
> Signed-off-by: Michal Nazarewicz <mina86@...a86.com>
> Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
> ---
>  drivers/usb/core/sysfs.c |    7 +++----
>  drivers/usb/core/usb.c   |    3 +--
>  drivers/usb/core/usb.h   |    2 +-
>  3 files changed, 5 insertions(+), 7 deletions(-)
> 
> The below patch has not been tested (not even compiled), just a quick scatch.

If you had compiled it, you would have seen why it's not a good idea to 
remove retval.  :-)

On the other hand, changing the function's return type to void is okay.  
I think the reason it returns int is historical; there used to be a
failure mode but it got removed.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ