* [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device
@ 2004-09-13 23:37 Hanna Linder
2004-09-14 0:29 ` Tonnerre
0 siblings, 1 reply; 7+ messages in thread
From: Hanna Linder @ 2004-09-13 23:37 UTC (permalink / raw)
To: rth, ink; +Cc: linux-kernel, greg, wli, hannal
Here is a very simple patch to convert pci_find_device call to pci_get_device.
As I don't have an alpha box or cross compiler could someone (wli- wink wink)
please verify it compiles and doesn't break anything, thanks a lot.
Hanna Linder
IBM Linux Technology Center
Signed-off-by: Hanna Linder <hannal@us.ibm.com>
diff -Nrup linux-2.6.9-rc1/arch/alpha/kernel/sys_sio.c linux-2.6.9-rc1-alpha/arch/alpha/kernel/sys_sio.c
--- linux-2.6.9-rc1/arch/alpha/kernel/sys_sio.c 2004-08-13 22:36:12.000000000 -0700
+++ linux-2.6.9-rc1-alpha/arch/alpha/kernel/sys_sio.c 2004-09-13 16:04:58.135130904 -0700
@@ -105,7 +105,7 @@ sio_collect_irq_levels(void)
struct pci_dev *dev = NULL;
/* Iterate through the devices, collecting IRQ levels. */
- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+ while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
if ((dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) &&
(dev->class >> 8 != PCI_CLASS_BRIDGE_PCMCIA))
continue;
@@ -229,7 +229,7 @@ alphabook1_init_pci(void)
*/
dev = NULL;
- while ((dev = pci_find_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
+ while ((dev = pci_get_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
if (dev->device == PCI_DEVICE_ID_NCR_53C810
|| dev->device == PCI_DEVICE_ID_NCR_53C815
|| dev->device == PCI_DEVICE_ID_NCR_53C820
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device
2004-09-13 23:37 [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device Hanna Linder
@ 2004-09-14 0:29 ` Tonnerre
2004-09-14 2:02 ` Richard Henderson
0 siblings, 1 reply; 7+ messages in thread
From: Tonnerre @ 2004-09-14 0:29 UTC (permalink / raw)
To: Hanna Linder; +Cc: rth, ink, linux-kernel, greg, wli
[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]
Salut,
On Mon, Sep 13, 2004 at 04:37:23PM -0700, Hanna Linder wrote:
> diff -Nrup linux-2.6.9-rc1/arch/alpha/kernel/sys_sio.c linux-2.6.9-rc1-alpha/arch/alpha/kernel/sys_sio.c
> --- linux-2.6.9-rc1/arch/alpha/kernel/sys_sio.c 2004-08-13 22:36:12.000000000 -0700
> +++ linux-2.6.9-rc1-alpha/arch/alpha/kernel/sys_sio.c 2004-09-13 16:04:58.135130904 -0700
> @@ -105,7 +105,7 @@ sio_collect_irq_levels(void)
> struct pci_dev *dev = NULL;
>
> /* Iterate through the devices, collecting IRQ levels. */
> - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
> + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
> if ((dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) &&
> (dev->class >> 8 != PCI_CLASS_BRIDGE_PCMCIA))
> continue;
> @@ -229,7 +229,7 @@ alphabook1_init_pci(void)
> */
>
> dev = NULL;
> - while ((dev = pci_find_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
> + while ((dev = pci_get_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
> if (dev->device == PCI_DEVICE_ID_NCR_53C810
> || dev->device == PCI_DEVICE_ID_NCR_53C815
> || dev->device == PCI_DEVICE_ID_NCR_53C820
Don't we need to put these devices in some place?
Tonnerre
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device
2004-09-14 0:29 ` Tonnerre
@ 2004-09-14 2:02 ` Richard Henderson
2004-09-14 2:21 ` Tonnerre
0 siblings, 1 reply; 7+ messages in thread
From: Richard Henderson @ 2004-09-14 2:02 UTC (permalink / raw)
To: Tonnerre; +Cc: Hanna Linder, ink, linux-kernel, greg, wli
On Tue, Sep 14, 2004 at 02:29:33AM +0200, Tonnerre wrote:
> > - while ((dev = pci_find_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
> > + while ((dev = pci_get_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
> > if (dev->device == PCI_DEVICE_ID_NCR_53C810
> > || dev->device == PCI_DEVICE_ID_NCR_53C815
> > || dev->device == PCI_DEVICE_ID_NCR_53C820
>
> Don't we need to put these devices in some place?
pci_get_device does that for non-null "from" argument.
r~
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device
2004-09-14 2:02 ` Richard Henderson
@ 2004-09-14 2:21 ` Tonnerre
2004-09-14 16:37 ` Hanna Linder
0 siblings, 1 reply; 7+ messages in thread
From: Tonnerre @ 2004-09-14 2:21 UTC (permalink / raw)
To: Hanna Linder, ink, linux-kernel, greg, wli
[-- Attachment #1: Type: text/plain, Size: 662 bytes --]
Salut,
On Mon, Sep 13, 2004 at 07:02:22PM -0700, Richard Henderson wrote:
> On Tue, Sep 14, 2004 at 02:29:33AM +0200, Tonnerre wrote:
> > > - while ((dev = pci_find_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
> > > + while ((dev = pci_get_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) {
> > > if (dev->device == PCI_DEVICE_ID_NCR_53C810
> > > || dev->device == PCI_DEVICE_ID_NCR_53C815
> > > || dev->device == PCI_DEVICE_ID_NCR_53C820
> >
> > Don't we need to put these devices in some place?
>
> pci_get_device does that for non-null "from" argument.
I was talking about pci_put_device(dev)..
Tonnerre
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device
2004-09-14 2:21 ` Tonnerre
@ 2004-09-14 16:37 ` Hanna Linder
0 siblings, 0 replies; 7+ messages in thread
From: Hanna Linder @ 2004-09-14 16:37 UTC (permalink / raw)
To: Tonnerre, ink, linux-kernel, greg, wli; +Cc: Hanna Linder
--On Tuesday, September 14, 2004 04:21:25 AM +0200 Tonnerre <tonnerre@thundrix.ch> wrote:
> On Mon, Sep 13, 2004 at 07:02:22PM -0700, Richard Henderson wrote:
>> On Tue, Sep 14, 2004 at 02:29:33AM +0200, Tonnerre wrote:
>> > Don't we need to put these devices in some place?
>>
>> pci_get_device does that for non-null "from" argument.
>
> I was talking about pci_put_device(dev)..
>
> Tonnerre
Hi Tonnerre,
I believe that is what Richard is talking about as well. When pci_get_device
is in a while loop the dereference is done automatically. See the code and
comments.
You will notice in the sys_alcor.c patch I did add the pci_dev_put (although
in the wrong place, new patch coming soon).
Regards,
Hanna
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device
@ 2004-09-14 22:56 Judith Lebzelter
2004-09-14 23:11 ` Hanna Linder
0 siblings, 1 reply; 7+ messages in thread
From: Judith Lebzelter @ 2004-09-14 22:56 UTC (permalink / raw)
To: linux-kernel; +Cc: hannal
I submitted these patches to PLM on linux-2.6.8. It automatically runs
compiles for several architectures, including 'alpha'.
http://www.osdl.org/plm-cgi/plm?module=patch_info&patch_id=3315
The alpha filter does a 'defconfig' build, and it had 2 warnings, 0
errors.
Unfortunately, the 2.6.9-rc1 has a few errors for the 'defconfig' build,
which is why I did not apply it there.
Judith Lebzelter
OSDL
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device
2004-09-14 22:56 Judith Lebzelter
@ 2004-09-14 23:11 ` Hanna Linder
0 siblings, 0 replies; 7+ messages in thread
From: Hanna Linder @ 2004-09-14 23:11 UTC (permalink / raw)
To: Judith Lebzelter, linux-kernel; +Cc: hannal, greg, wli
--On Tuesday, September 14, 2004 03:56:54 PM -0700 Judith Lebzelter <judith@osdl.org> wrote:
> The alpha filter does a 'defconfig' build, and it had 2 warnings, 0
> errors.
>
> Unfortunately, the 2.6.9-rc1 has a few errors for the 'defconfig' build,
> which is why I did not apply it there.
>
> Judith Lebzelter
> OSDL
Thanks Judith,
That is awesome. I see the warnings were for different .c files than the ones my patches touched.
Warning List:
drivers/serial/8250_pnp.c:421: warning: cast to pointer from integer of different size
drivers/serial/8250_pnp.c:428: warning: cast from pointer to integer of different size
RESULT: PASS
RESULT-DETAIL: 2 warnings, 0 errors
So it appears all is good with my patches. Thanks a lot!
Hanna
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-09-14 23:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-13 23:37 [RFT 2.6.9-rc1 alpha sys_sio.c] [2/2] convert pci_find_device to pci_get_device Hanna Linder
2004-09-14 0:29 ` Tonnerre
2004-09-14 2:02 ` Richard Henderson
2004-09-14 2:21 ` Tonnerre
2004-09-14 16:37 ` Hanna Linder
-- strict thread matches above, loose matches on Subject: below --
2004-09-14 22:56 Judith Lebzelter
2004-09-14 23:11 ` Hanna Linder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox