Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756977Ab1CXPwi (ORCPT ); Thu, 24 Mar 2011 11:52:38 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:45752 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754634Ab1CXPwh (ORCPT ); Thu, 24 Mar 2011 11:52:37 -0400 Date: Thu, 24 Mar 2011 11:52:36 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Michal Nazarewicz cc: Sergey Senozhatsky , Greg Kroah-Hartman , Chris Wright , , , Michal Nazarewicz Subject: Re: [PATCH] usb: core: Change usb_create_sysfs_intf_files()' return type to void In-Reply-To: <7269aca0469928347bbff55c8c2efd1c86cf1f4b.1300979212.git.mina86@mina86.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1258 Lines: 33 On Thu, 24 Mar 2011, Michal Nazarewicz wrote: > From: Michal Nazarewicz > > 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 > Cc: Sergey Senozhatsky > --- > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/