All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjanv@redhat.com>
To: linux-scsi@vger.kernel.org
Subject: mark scsi_add_host() as __must_check
Date: Mon, 23 Aug 2004 13:24:40 +0200	[thread overview]
Message-ID: <20040823112440.GA31874@devserv.devel.redhat.com> (raw)

Hi,

It seems it's a dangerous trap to write the following code:

        scsi_add_host(host, &pdev->dev);
        scsi_scan_host(host);

without checking the return value of scsi_add_host; it seems scsi_add_host()
is one of those functions that you reall have to check the return value of,
this patch makes it so:

--- linux-2.6.7/include/scsi/scsi_host.h~	2004-08-03 11:33:19.127693290 +0200
+++ linux-2.6.7/include/scsi/scsi_host.h	2004-08-03 11:33:19.127693290 +0200
@@ -524,7 +524,7 @@
 	container_of(d, struct Scsi_Host, shost_classdev)
 
 extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
-extern int scsi_add_host(struct Scsi_Host *, struct device *);
+extern int __must_check scsi_add_host(struct Scsi_Host *, struct device *);
 extern void scsi_scan_host(struct Scsi_Host *);
 extern void scsi_remove_host(struct Scsi_Host *);
 extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);

                 reply	other threads:[~2004-08-23 11:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040823112440.GA31874@devserv.devel.redhat.com \
    --to=arjanv@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.