linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Douglas Gilbert <dgilbert@interlog.com>,
	Richard Sharpe <realrichardsharpe@gmail.com>,
	Christoph Hellwig <hch@lst.de>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Mike Christie <michaelc@cs.wisc.edu>,
	Hannes Reinecke <hare@suse.de>,
	James Bottomley <James.Bottomley@suse.de>,
	Greg KH <greg@kroah.com>
Subject: Re: [PATCH] scsi_debug: Convert to use root_device_register() and root_device_unregister()
Date: Mon, 6 Sep 2010 17:12:18 -0700	[thread overview]
Message-ID: <20100907001218.GA20882@core.coreip.homeip.net> (raw)
In-Reply-To: <1283816354.556.251.camel@haakon2.linux-iscsi.org>

On Mon, Sep 06, 2010 at 04:39:14PM -0700, Nicholas A. Bellinger wrote:
> On Mon, 2010-09-06 at 16:41 -0700, Dmitry Torokhov wrote:
> > On Mon, Sep 06, 2010 at 03:32:20PM -0700, Nicholas A. Bellinger wrote:
> > >  static int __init scsi_debug_init(void)
> > >  {
> > >  	unsigned long sz;
> > >  	int host_to_add;
> > >  	int k;
> > > -	int ret;
> > > +	int ret = 0;
> > >  
> > 
> > Please do not initialize error condition with success; when adding
> > additional initialization it makes easy to miss assigning proper return
> > value (as you seem to have) and return success in case of failure.
> 
> The reason this was added because my gcc (Debian 4.3.2-1.1) 4.3.2
> complained about this being possibily uninitialized..
> 

And rightly so - you did not assign a value to it when handling
root_device_register() failure. Compiler warnings are generally there
for a reason, not just a nuisance that should be shut off without a
second thought.

-- 
Dmitry

      reply	other threads:[~2010-09-07  0:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-06 22:32 [PATCH] scsi_debug: Convert to use root_device_register() and root_device_unregister() Nicholas A. Bellinger
2010-09-06 23:41 ` Dmitry Torokhov
2010-09-06 23:39   ` Nicholas A. Bellinger
2010-09-07  0:12     ` Dmitry Torokhov [this message]

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=20100907001218.GA20882@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=dgilbert@interlog.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=greg@kroah.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=nab@linux-iscsi.org \
    --cc=realrichardsharpe@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).