Re: droping a patch in mm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 25 Sep 2006 12:39:01 +0200
Henne <[email protected]> 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 <[email protected]>
> 
> 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 <[email protected]>

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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux