[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1103251131380.2047-100000@iolanthe.rowland.org>
Date: Fri, 25 Mar 2011 11:33:12 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Michal Nazarewicz <mnazarewicz@...gle.com>
cc: Greg Kroah-Hartman <gregkh@...e.de>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Chris Wright <chrisw@...s-sol.org>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Michal Nazarewicz <mina86@...a86.com>
Subject: Re: [PATCHv2] usb: core: Change usb_create_sysfs_intf_files()' return
type to void
On Fri, 25 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 | 13 +++++--------
> drivers/usb/core/usb.c | 3 +--
> drivers/usb/core/usb.h | 2 +-
> 3 files changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
> index 6781c36..f5b7b1c 100644
> --- a/drivers/usb/core/sysfs.c
> +++ b/drivers/usb/core/sysfs.c
> @@ -842,22 +842,19 @@ const struct attribute_group *usb_interface_groups[] = {
> NULL
> };
>
> -int usb_create_sysfs_intf_files(struct usb_interface *intf)
> +void usb_create_sysfs_intf_files(struct usb_interface *intf)
> {
> struct usb_device *udev = interface_to_usbdev(intf);
> struct usb_host_interface *alt = intf->cur_altsetting;
> - int retval;
>
> if (intf->sysfs_files_created || intf->unregistering)
> - return 0;
> + return;
>
> - if (alt->string == NULL &&
> - !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
> + if (!alt->string && !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
> alt->string = usb_cache_string(udev, alt->desc.iInterface);
> - if (alt->string)
> - retval = device_create_file(&intf->dev, &dev_attr_interface);
> + if (alt->string && device_create_file(&intf->dev, &dev_attr_interface))
> + /* We don't actually care if the function fails. */;
My style preference is to put the empty statement before the comment.
It's unusual to have a comment appearing before a statement on the same
line. For example:
; /* We don't care if the function fails */
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