Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759129Ab0FPPeL (ORCPT ); Wed, 16 Jun 2010 11:34:11 -0400 Received: from cantor.suse.de ([195.135.220.2]:60481 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759082Ab0FPPeJ (ORCPT ); Wed, 16 Jun 2010 11:34:09 -0400 Subject: Re: [PATCH 5/5]scsi:hosts.c Fix warning: variable 'rval' set but not used From: James Bottomley To: "Justin P. Mattock" Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org In-Reply-To: <1276666434-11227-6-git-send-email-justinmattock@gmail.com> References: <1276666434-11227-1-git-send-email-justinmattock@gmail.com> <1276666434-11227-6-git-send-email-justinmattock@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 16 Jun 2010 10:34:03 -0500 Message-ID: <1276702443.2847.153.camel@mulgrave.site> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1758 Lines: 48 On Tue, 2010-06-15 at 22:33 -0700, Justin P. Mattock wrote: > The below patch fixes a warning message generated by gcc 4.6.0 > CC drivers/scsi/hosts.o > drivers/scsi/hosts.c: In function 'scsi_host_alloc': > drivers/scsi/hosts.c:328:6: warning: variable 'rval' set but not used > > Signed-off-by: Justin P. Mattock > > --- > drivers/scsi/hosts.c | 2 -- > 1 files changed, 0 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c > index 6660fa9..00fd6a4 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,6 @@ 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); > goto fail_kfree; > } For future reference, this is less stylistically acceptable C: you've reduced the if clause to a single statement, so the braces need removing. 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. James -- 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/