linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org,
	James Bottomley <James.Bottomley@steeleye.com>,
	Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	Bolke de Bruin <bdbruin@aub.nl>, Greg KH <greg@kroah.com>
Subject: Re: [PATCH 2.6.13-rc6] MODULE_DEVICE_TABLE for cpqfcTS driver
Date: Tue, 16 Aug 2005 14:53:02 +0200	[thread overview]
Message-ID: <4301E1AE.6010501@gmail.com> (raw)
In-Reply-To: <200508161111.35431@bilbo.math.uni-mannheim.de>

Rolf Eike Beer napsal(a):

>Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
>
>--- a/drivers/scsi/cpqfcTSinit.c	2005-08-14 14:20:40.000000000 +0200
>+++ b/drivers/scsi/cpqfcTSinit.c	2005-08-14 14:25:33.000000000 +0200
>@@ -264,18 +264,14 @@ static void launch_FCworker_thread(struc
>  * Agilent XL2 
>  * HP Tachyon
>  */
>-#define HBA_TYPES 3
>-
>-#ifndef PCI_DEVICE_ID_COMPAQ_
>-#define PCI_DEVICE_ID_COMPAQ_TACHYON	0xa0fc
>-#endif
>-
>-static struct SupportedPCIcards cpqfc_boards[] __initdata = {
>-	{PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TACHYON},
>-	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_TACHLITE},
>-	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_TACHYON},
>+static struct pci_device_id cpqfc_boards[] __initdata = {
>+	{PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_TACHYON, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
>+	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_TACHLITE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
>+	{PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_TACHYON, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
>+	{0, }
> };
>  
>
Wouldn't be better to use PCI_DEVICE macro for better readability?

> 
>+MODULE_DEVICE_TABLE(pci, cpqfc_boards);
> 
> int cpqfcTS_detect(Scsi_Host_Template *ScsiHostTemplate)
> {
>@@ -294,14 +290,9 @@ int cpqfcTS_detect(Scsi_Host_Template *S
>   ScsiHostTemplate->proc_name = "cpqfcTS";
> #endif
> 
>-  for( i=0; i < HBA_TYPES; i++)
>-  {
>-    // look for all HBAs of each type
>-
>-    while((PciDev = pci_find_device(cpqfc_boards[i].vendor_id,
>-				    cpqfc_boards[i].device_id, PciDev)))
>-    {
>-
>+  for(i = 0; cpqfc_boards[i]; i++) {
>+    while((PciDev = pci_get_device(cpqfc_boards[i].vendor,
>+				    cpqfc_boards[i].device, PciDev))) {
>       if (pci_enable_device(PciDev)) {
> 	printk(KERN_ERR
> 		"cpqfc: can't enable PCI device at %s\n", pci_name(PciDev));
>  
>
You maybe forgot to add pci_dev_put in error cases. You can inspire 
yourself here:
http://www.fi.muni.cz/~xslaby/lnx/pci_find/drivers:scsi:cpqfcTSinit.c.txt
(it wasn't accepted yet).

BTW. Greg KH wants me to cc him, if some of these changes are being done.

regards,

-- 
Jiri Slaby         www.fi.muni.cz/~xslaby
~\-/~      jirislaby@gmail.com      ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10


  parent reply	other threads:[~2005-08-16 12:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-05 10:02 [PATCH 2.6.13-rc5] reduce whitespace bloat in drivers/scsi/cpqfcTScontrol.c Rolf Eike Beer
2005-08-09 16:06 ` [PATCH 2.6.13-rc5] rewrite drivers/scsi/cpqfcTScontrol.c::CpqTsGetSFQEntry Rolf Eike Beer
2005-08-16  9:11   ` [PATCH 2.6.13-rc6] remove dead reset function from cpqfcTS driver Rolf Eike Beer
2005-08-16  9:11     ` [PATCH 2.6.13-rc6] MODULE_DEVICE_TABLE for " Rolf Eike Beer
2005-08-16  9:12       ` [PATCH 2.6.13-rc6] remove 2.4 compat code from " Rolf Eike Beer
2005-08-16  9:13         ` [PATCH 2.6.13-rc6] more whitespace cleanups for cpqfcTS Rolf Eike Beer
2005-08-16  9:14           ` [PATCH 2.6.13-rc6] remove superfluos ioctls from cpqfcTS Rolf Eike Beer
2005-08-16 14:58             ` [PATCH 2.6.13-rc6] improve start/stop code for worker thread in cpqfcTS driver Rolf Eike Beer
2005-08-16 16:20               ` [PATCH 2.6.13-rc6] improve start/stop code for worker thread in cpqfcTS driver, take 2 Rolf Eike Beer
2005-08-16 16:24                 ` Christoph Hellwig
2005-08-16 17:09                 ` [PATCH 2.6.13-rc6] improve start/stop code for worker thread in cpqfcTS driver, take 3 Rolf Eike Beer
2005-08-17  8:57                   ` [PATCH 2.6.13-rc6] fix copying stack memory in cpqfcTScontrol.c::cpqfcTSPutLinkQue() Rolf Eike Beer
2005-08-16 14:28         ` [PATCH 2.6.13-rc6] remove 2.4 compat code from cpqfcTS driver, take 2 Rolf Eike Beer
2005-08-16 14:51           ` [PATCH 2.6.13-rc6] remove 2.4 compat code from cpqfcTS driver, take 3 Rolf Eike Beer
2005-08-16 12:53       ` Jiri Slaby [this message]
2005-08-16 13:57         ` [PATCH 2.6.13-rc6] MODULE_DEVICE_TABLE for cpqfcTS driver Rolf Eike Beer
2005-08-16 14:36       ` [PATCH 2.6.13-rc6] MODULE_DEVICE_TABLE for cpqfcTS driver, take 2 Rolf Eike Beer
2005-08-16  9:17     ` [PATCH 2.6.13-rc6] remove dead reset function from cpqfcTS driver Christoph Hellwig
2005-08-16  9:37       ` Rolf Eike Beer
2005-08-16 14:49         ` Martin K. Petersen
2005-08-16 15:07           ` Rolf Eike Beer

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=4301E1AE.6010501@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=bdbruin@aub.nl \
    --cc=eike-kernel@sf-tec.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=torvalds@osdl.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;
as well as URLs for NNTP newsgroup(s).