Re: [PATCH] usb: core: Change usb_create_sysfs_intf_files()' return type to void

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 24 Mar 2011, Michal Nazarewicz wrote:
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.
[...]
The below patch has not been tested (not even compiled), just a quick scatch.

On Thu, 24 Mar 2011 16:52:36 +0100, Alan Stern wrote:
If you had compiled it, you would have seen why it's not a good idea to
remove retval.  :-)

I must be getting blind...  I explicitly checked if device_create_file()
has __must_check attribute but somehow missed it.

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.

In that case I can prepare a v2 later today (unless Sergey feels like
doing that).

--
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@xxxxxxxxxx>-----ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux