From: Boaz Harrosh <bharrosh@panasas.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Sergio Luis <sergio@larces.uece.br>,
Achim Leubner <achim_leubner@adaptec.com>,
linux-scsi@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] 2.6.25-rc1-git2: GDT SCSI: change drivers/scsi/gdth.c into using pci_get device
Date: Tue, 12 Feb 2008 18:54:29 +0200 [thread overview]
Message-ID: <47B1CF45.5070407@panasas.com> (raw)
In-Reply-To: <1202833354.3137.19.camel@localhost.localdomain>
On Tue, Feb 12 2008 at 18:22 +0200, James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> On Tue, 2008-02-12 at 11:31 -0300, Sergio Luis wrote:
>> Fix compilation warning in drivers/scsi/gdth.c, using deprecated pci_find_device.
>> Change it into using pci_get_device instead:
>> drivers/scsi/gdth.c:645: warning: 'pci_find_device' is deprecated (declared at include/linux/pci.h:495)
>>
>> Signed-off-by: Sergio Luis <sergio@larces.uece.br>
>>
>> gdth.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>
>> diff -urN linux-2.6.25-rc1-git2.orig/drivers/scsi/gdth.c linux-2.6.25-rc1-git2/drivers/scsi/gdth.c
>> --- linux-2.6.25-rc1-git2.orig/drivers/scsi/gdth.c 2008-02-12 09:26:14.000000000 -0300
>> +++ linux-2.6.25-rc1-git2/drivers/scsi/gdth.c 2008-02-12 10:33:08.000000000 -0300
>> @@ -642,7 +642,7 @@
>> *cnt, vendor, device));
>>
>> pdev = NULL;
>> - while ((pdev = pci_find_device(vendor, device, pdev))
>> + while ((pdev = pci_get_device(vendor, device, pdev))
>> != NULL) {
>> if (pci_enable_device(pdev))
>> continue;
>
> This can't be correct without a matching put in the error leg.
>
> The difference between the two APIs is that pci_get_device returns a
> pci_device with a reference taken and pci_find_device doesn't. However,
> pci_get_device does drop the reference again so as long as you never
> exit the loop until it returns NULL, it is OK ... it's the exits before
> pci_get_device() returns NULL that need the put.
>
> James
>
Yes you are right I have just realized that. Reinspecting pci_get_device()
Sergio will you do it? or should I have a try?
Boaz
next prev parent reply other threads:[~2008-02-12 16:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-12 14:31 [PATCH] 2.6.25-rc1-git2: GDT SCSI: change drivers/scsi/gdth.c into using pci_get device Sergio Luis
2008-02-12 16:22 ` James Bottomley
2008-02-12 16:54 ` Boaz Harrosh [this message]
[not found] ` <47B23033.1080100@larces.uece.br>
2008-02-13 0:17 ` James Bottomley
2008-02-13 8:57 ` Boaz Harrosh
2008-02-16 16:37 ` Matthew Wilcox
2008-02-17 10:37 ` Boaz Harrosh
2008-02-17 16:42 ` Jeff Garzik
2008-02-17 16:42 ` Jeff Garzik
2008-03-04 7:48 ` Hannes Reinecke
2008-03-04 7:48 ` Hannes Reinecke
2008-03-04 12:04 ` Boaz Harrosh
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=47B1CF45.5070407@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=achim_leubner@adaptec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sergio@larces.uece.br \
/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.