mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Henne <henne@nachtwindheim.de>
Cc: jirislaby@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: droping a patch in mm
Date: Tue, 26 Sep 2006 14:47:16 -0700	[thread overview]
Message-ID: <20060926144716.5cb606a1.akpm@osdl.org> (raw)
In-Reply-To: <4517B1C5.30609@nachtwindheim.de>

On Mon, 25 Sep 2006 12:39:01 +0200
Henne <henne@nachtwindheim.de> wrote:

> >Jiri Slaby schrieb:
> 
> >>Henne wrote:
> >>Hi!
> >>Would you please drop:
> >>pci_module_init_conversion-in-scsi-subsys-2nd-try.patch
> >>cause it the moving of libata now it will only produce a lot of errors.
> >>I'll rewrite it today.
> >
> >And this wrong too in that patch:
> >-    /* Translate error or zero return into zero or one */
> >-    return pci_module_init(&aic7xxx_pci_driver) ? 0 : 1;
> >+    return pci_register_driver(&aic7xxx_pci_driver);
> >
> >regards,
> 
> Acked! But I don't think thats good style to __translate__ return values,
> even if this one is ignored.
> I'll keep it the way it was and just change pci_module_init() into pci_register_driver().
> 
> From: Henrik Kretzschmar <henne@nachtwindheim.de>
> 
> Changes pci_module_init() to pci_register_driver() in the scsi-subsys
> for drivers which just return the returvalue of that function.
> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>

Your new patch boils down to this:

--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c~pci_module_init-conversion-in-scsi-subsys-2nd-try-update
+++ a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -246,7 +246,8 @@ ahc_linux_pci_dev_probe(struct pci_dev *
 int
 ahc_linux_pci_init(void)
 {
-	return pci_register_driver(&aic7xxx_pci_driver);
+	/* Translate error or zero return into zero or one */
+	return pci_register_driver(&aic7xxx_pci_driver) ? 0 : 1;
 }
 
 void
_


But the earlier verion was better, and ahc_linux_pci_init() has only one
caller which cheerfully ignores the error code anyway.

pci_register_driver() is (or will be) marked __must_check. 
ahc_linux_pci_init() will cunningly suppress that warning, while leaving the
driver in an incorrect state.

An appropriate fix would be to teach the rather optimistic ahc_linux_init()
about failures.

      reply	other threads:[~2006-09-26 21:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-25  8:27 Henne
2006-09-25  8:37 ` Jiri Slaby
2006-09-25 10:39   ` Henne
2006-09-26 21:47     ` Andrew Morton [this message]

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=20060926144716.5cb606a1.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=henne@nachtwindheim.de \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®