[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201006161925.43956.eike-kernel@sf-tec.de>
Date: Wed, 16 Jun 2010 19:25:43 +0200
From: Rolf Eike Beer <eike-kernel@...tec.de>
To: "Justin P. Mattock" <justinmattock@...il.com>
Cc: James Bottomley <James.Bottomley@...e.de>,
linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
linux-pci@...r.kernel.org, linux-scsi@...r.kernel.org
Subject: Re: [PATCH 5/5]scsi:hosts.c Fix warning: variable 'rval' set but not used
Justin P. Mattock wrote:
> On 06/16/2010 08:34 AM, James Bottomley wrote:
> > However, I don't think we should be ignoring the fact that the eh thread
> > failed to spawn, so I think some type of printed warning (giving the
> > error code) would be a much more appropriate replacement.
> o.k. I'll give a try at that.. as a test I did this(below) seemed to
> compile clean, but not sure if this is what you're asking for though:
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index 6660fa9..8d98a46 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -325,7 +325,6 @@ struct Scsi_Host *scsi_host_alloc(struct
> scsi_host_template *sht, int privsize)
> {
> struct Scsi_Host *shost;
> gfp_t gfp_mask = GFP_KERNEL;
> - int rval;
>
> if (sht->unchecked_isa_dma && privsize)
> gfp_mask |= __GFP_DMA;
> @@ -420,7 +419,7 @@ struct Scsi_Host *scsi_host_alloc(struct
> scsi_host_template *sht, int privsize)
> shost->ehandler = kthread_run(scsi_error_handler, shost,
> "scsi_eh_%d", shost->host_no);
> if (IS_ERR(shost->ehandler)) {
> - rval = PTR_ERR(shost->ehandler);
> + printk(KERN_WARNING "test.....\n");
> goto fail_kfree;
> }
If you want to print anything here I think the error code would be a good
thing to include as that could give a hint _what_ actually went wrong. In that
case you would need rval, but IMHO it should be declared inside that if
clause.
Eike
Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists