public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Justin P. Mattock" <justinmattock@gmail.com>
To: Valdis.Kletnieks@vt.edu
Cc: linux-usb@vger.kernel.org, dbrownell@users.sourceforge.net,
	gregkh@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2]drivers/usb/core/sysfs.c Fix variable 'retval' set but not used
Date: Tue, 03 Aug 2010 06:30:24 -0700	[thread overview]
Message-ID: <4C5819F0.3040104@gmail.com> (raw)
In-Reply-To: <58611.1280834905@localhost>

On 08/03/2010 04:28 AM, Valdis.Kletnieks@vt.edu wrote:
> On Mon, 02 Aug 2010 21:26:28 PDT, "Justin P. Mattock" said:
>> diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
>
>>   	if (alt->string)
>> -		retval = device_create_file(&intf->dev,&dev_attr_interface);
>> +		device_create_file(&intf->dev,&dev_attr_interface);
>>   	intf->sysfs_files_created = 1;
>>   	return 0;
>
> What should the code do if device_create_file() manages to fail? Yes, ignoring
> the return value is one option, but is it the best one?  'return ret;' might be
> another one. Somebody who understands this code and has more caffeine than me
> should look this over.
>
ignoring the return value is one option, but is it the best one? 
probably not. As for return ret; the option did cross my mind, but 
figured to do what I had done by removing the retval

> (Nothing personal Justin - it's just my opinion that *anytime* we have a patch
> that remove a check for a return code, it needs to justify that ignoring the
> return code is appropriate).
>

nothing personal taken.. in fact I agree with that whole paragraph. 
looking back I should of really explained why I was removing this code 
besides a warning message.

Thanks for the response and info on this..

Justin P. Mattock


  reply	other threads:[~2010-08-03 13:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03  4:26 [PATCH 1/2]drivers/usb/core/sysfs.c Fix variable 'retval' set but not used Justin P. Mattock
2010-08-03  4:26 ` [PATCH 2/2]drivers/usb/host/ehci-hub.c Fix variable 'i' " Justin P. Mattock
2010-08-03 11:28 ` [PATCH 1/2]drivers/usb/core/sysfs.c Fix variable 'retval' " Valdis.Kletnieks
2010-08-03 13:30   ` Justin P. Mattock [this message]
2010-08-03 14:29   ` Alan Stern
2010-08-03 14:43     ` Justin P. Mattock
2010-08-03 15:36       ` Alan Stern
2010-08-03 16:12         ` Justin P. Mattock
2010-08-03 15:13     ` Valdis.Kletnieks
2010-08-03 15:34       ` Alan Stern
2010-08-03 15:46         ` Greg KH
2010-08-03 17:09           ` Alan Stern
2010-08-03 17:22             ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C5819F0.3040104@gmail.com \
    --to=justinmattock@gmail.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=dbrownell@users.sourceforge.net \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox