Skip to content

Commit

Permalink
[SCSI] scsi:hosts.c Fix warning: variable 'rval' set but not used
Browse files Browse the repository at this point in the history
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

Fix this by removing the rval but placing a printk warning where it
would have been set.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Justin P. Mattock authored and James Bottomley committed Jul 27, 2010
1 parent 6e49949 commit e4bf25f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -420,7 +419,8 @@ 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 "scsi%d: error handler thread failed to spawn, error = %ld\n",
shost->host_no, PTR_ERR(shost->ehandler));
goto fail_kfree;
}

Expand Down

0 comments on commit e4bf25f

Please sign in to comment.