public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <James.Bottomley@steeleye.com>,
	"Daniel M. Eischen" <deischen@iworks.interworks.org>,
	Doug Ledford <dledford@redhat.com>,
	James.Bottomley@hansenpartnership.com,
	Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH] fix warning and missing failure handling for scsi_add_host in aic7xxx driver
Date: Wed, 14 Dec 2005 00:07:19 +0100	[thread overview]
Message-ID: <200512140007.20046.jesper.juhl@gmail.com> (raw)

Hi,

Here's a patch to fix a compiler warning and problem with missing failure 
handling of scsi_add_host noted in comment in aic7xxx_osm

The warning I see (with 2.6.15-rc5-git3) is this one:
drivers/scsi/aic7xxx/aic7xxx_osm.c:1100: warning: ignoring return value of \x13csi_add_host', declared with attribute warn_unused_result

The patch has seen the following testing:
 - compile tested
 - boot tested on a machine using the AIC7XXX driver

Please review and consider for inclusion.


Signed-off-by: Jesper Juhl <jeser.juhl@gmail.com>
---

 drivers/scsi/aic7xxx/aic7xxx_osm.c |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

--- linux-2.6.15-rc5-git3-orig/drivers/scsi/aic7xxx/aic7xxx_osm.c	2005-12-04 18:48:12.000000000 +0100
+++ linux-2.6.15-rc5-git3/drivers/scsi/aic7xxx/aic7xxx_osm.c	2005-12-13 23:47:45.000000000 +0100
@@ -1061,10 +1061,11 @@ uint32_t aic7xxx_verbose;
 int
 ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *template)
 {
-	char	 buf[80];
-	struct	 Scsi_Host *host;
+	char	buf[80];
+	struct	Scsi_Host *host;
 	char	*new_name;
-	u_long	 s;
+	u_long	s;
+	int	retval = 0;
 
 	template->name = ahc->description;
 	host = scsi_host_alloc(template, sizeof(struct ahc_softc *));
@@ -1097,9 +1098,20 @@ ahc_linux_register_host(struct ahc_softc
 
 	host->transportt = ahc_linux_transport_template;
 
-	scsi_add_host(host, (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); /* XXX handle failure */
+	retval = scsi_add_host(host,
+			(ahc->dev_softc ? &ahc->dev_softc->dev : NULL));
+	if (retval) {
+		printk(KERN_ERR "aic7xxx: scsi_add_host failed\n");
+		goto free_and_out;
+	}
+
 	scsi_scan_host(host);
-	return (0);
+
+out:
+	return retval;
+free_and_out:
+	scsi_remove_host(host);
+	goto out;
 }
 
 /*

             reply	other threads:[~2005-12-13 23:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-13 23:07 Jesper Juhl [this message]
2005-12-14  4:33 ` [PATCH] fix warning and missing failure handling for scsi_add_host in aic7xxx driver James Bottomley
2005-12-14  8:02   ` Jesper Juhl
2005-12-14  8:20     ` James Bottomley
2005-12-14  8:37       ` Jesper Juhl

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=200512140007.20046.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=deischen@iworks.interworks.org \
    --cc=dledford@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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