* Re: [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning
2008-07-27 7:51 [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning Michael Borisov
@ 2008-07-27 8:15 ` Julia Lawall
2008-07-27 9:56 ` Michael Borisov
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2008-07-27 8:15 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1274 bytes --]
On Sun, 27 Jul 2008, Michael Borisov wrote:
> Probably now it is correct ?
Please explain why.
julia
> This patch fixes the following compile warning:
>
> drivers/isdn/hisax/telespci.c: In function ÿÿsetup_telespciÿÿ:
> drivers/isdn/hisax/telespci.c:303: warning: ÿÿpci_find_deviceÿÿ is
> deprecated (declared at include/linux/pci.h:535)
>
> Signed-off-by: Michael Borisov <niro@tut.by>
> ---
> diff --git a/drivers/isdn/hisax/telespci.c
> b/drivers/isdn/hisax/telespci.c
> index 28b08de..1142f35 100644
> --- a/drivers/isdn/hisax/telespci.c
> +++ b/drivers/isdn/hisax/telespci.c
> @@ -300,7 +300,9 @@ setup_telespci(struct IsdnCard *card)
> if (cs->typ != ISDN_CTYPE_TELESPCI)
> return (0);
>
> - if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN,
> PCI_DEVICE_ID_ZORAN_36120, dev_tel))) {
> + dev_tel = pci_get_device (PCI_VENDOR_ID_ZORAN,
> PCI_DEVICE_ID_ZORAN_36120, NULL);
> + if (dev_tel) {
> + pci_dev_put(dev_tel);
> if (pci_enable_device(dev_tel))
> return(0);
> cs->irq = dev_tel->irq;
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning
2008-07-27 7:51 [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning Michael Borisov
2008-07-27 8:15 ` Julia Lawall
@ 2008-07-27 9:56 ` Michael Borisov
2008-07-27 10:13 ` Julia Lawall
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michael Borisov @ 2008-07-27 9:56 UTC (permalink / raw)
To: kernel-janitors
> > Probably now it is correct ?
>
> Please explain why.
Because added pci_dev_put() and not used assignment in if condition.
Right ?
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning
2008-07-27 7:51 [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning Michael Borisov
2008-07-27 8:15 ` Julia Lawall
2008-07-27 9:56 ` Michael Borisov
@ 2008-07-27 10:13 ` Julia Lawall
2008-07-27 16:00 ` Julia Lawall
2008-07-27 16:37 ` Michael Borisov
4 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2008-07-27 10:13 UTC (permalink / raw)
To: kernel-janitors
On Sun, 27 Jul 2008, Michael Borisov wrote:
>
> > > Probably now it is correct ?
> >
> > Please explain why.
>
>
> Because added pci_dev_put() and not used assignment in if condition.
> Right ?
The question is whether this is the right time to do pci_dev_put() for
that value and whether someone will do pci_dev_put(), if needed, for the
new value.
julia
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning
2008-07-27 7:51 [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning Michael Borisov
` (2 preceding siblings ...)
2008-07-27 10:13 ` Julia Lawall
@ 2008-07-27 16:00 ` Julia Lawall
2008-07-27 16:37 ` Michael Borisov
4 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2008-07-27 16:00 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1866 bytes --]
Some points that I did not pick up on the first time:
1. You have changed the semantics by putting NULL as the last argument of
pci_get_device. The last argument of pci_find_device is the one from
which to start searching for the result. With NULL as the last argument,
it starts the search from the beginning of the list.
2. By immediately dropping the reference count, you have at best preserved
the behavior of pci_find_device, in which the object is not protected from
being freed, and at worst caused the object to be freed immediately, if no
one else has increased its reference count.
julia
On Sun, 27 Jul 2008, Michael Borisov wrote:
> Probably now it is correct ?
> This patch fixes the following compile warning:
>
> drivers/isdn/hisax/telespci.c: In function ÿÿsetup_telespciÿÿ:
> drivers/isdn/hisax/telespci.c:303: warning: ÿÿpci_find_deviceÿÿ is
> deprecated (declared at include/linux/pci.h:535)
>
> Signed-off-by: Michael Borisov <niro@tut.by>
> ---
> diff --git a/drivers/isdn/hisax/telespci.c
> b/drivers/isdn/hisax/telespci.c
> index 28b08de..1142f35 100644
> --- a/drivers/isdn/hisax/telespci.c
> +++ b/drivers/isdn/hisax/telespci.c
> @@ -300,7 +300,9 @@ setup_telespci(struct IsdnCard *card)
> if (cs->typ != ISDN_CTYPE_TELESPCI)
> return (0);
>
> - if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN,
> PCI_DEVICE_ID_ZORAN_36120, dev_tel))) {
> + dev_tel = pci_get_device (PCI_VENDOR_ID_ZORAN,
> PCI_DEVICE_ID_ZORAN_36120, NULL);
> + if (dev_tel) {
> + pci_dev_put(dev_tel);
> if (pci_enable_device(dev_tel))
> return(0);
> cs->irq = dev_tel->irq;
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning
2008-07-27 7:51 [PATCH 1/14 v2] drivers/isdn/hisax/telespci.c: fix warning Michael Borisov
` (3 preceding siblings ...)
2008-07-27 16:00 ` Julia Lawall
@ 2008-07-27 16:37 ` Michael Borisov
4 siblings, 0 replies; 6+ messages in thread
From: Michael Borisov @ 2008-07-27 16:37 UTC (permalink / raw)
To: kernel-janitors
Signed-off-by: Michael Borisov <niro@tut.by>
---
diff --git a/drivers/isdn/hisax/telespci.c
b/drivers/isdn/hisax/telespci.c
index 28b08de..2ebcbc9 100644
--- a/drivers/isdn/hisax/telespci.c
+++ b/drivers/isdn/hisax/telespci.c
@@ -300,7 +300,9 @@ setup_telespci(struct IsdnCard *card)
if (cs->typ != ISDN_CTYPE_TELESPCI)
return (0);
- if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN,
PCI_DEVICE_ID_ZORAN_36120, dev_tel))) {
+ dev_tel = pci_get_device (PCI_VENDOR_ID_ZORAN,
PCI_DEVICE_ID_ZORAN_36120, dev_tel);
+ if (dev_tel) {
+ pci_dev_put(dev_tel);
if (pci_enable_device(dev_tel))
return(0);
cs->irq = dev_tel->irq;
^ permalink raw reply related [flat|nested] 6+ messages in thread