Re: [PATCH] pci_find_device --> pci_get_device

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

 



Jiri Slaby wrote:
>The patch is for mixed files from all over the tree.
>
>Kernel version: 2.6.13-rc3-git4
>
>* This patch removes from kernel tree pci_find_device and changes
>it with pci_get_device. Next, it adds pci_dev_put, to decrease reference
>count of the variable.
>* Next, there are some (about 10 or so) gcc warning problems (i. e.
>variable may be unitialized) solutions, which were around code with old
>pci_find_device.

Is this the reason why you initialize members of static structs? If this is 
uninitialized it will end in the bss section and will be zeroed before the 
kernel uses is. If you do it will go into data section and add more bloat to 
the binary. At least this is the explanation I got once why not to do this.

Many of the callers of pci_find_device() look like they are not ported to the 
2.6 driver API and do the scanning for devices themself. I think it would be 
a good idea to try to convert them to the new driver model instead of 
replacing this. When you mark this deprecated and they still use the old 
function everyone using this will see that there is some work to do.

>* Some code was unpretty, or ugly, so the patch provides more readable
>code, in some cases.

If you try to beautify code then please use for_each_pci_dev() macro from 
include/linux/pci.h where possible.

When you want something of this getting included you have to split that into 
pieces. Use extra patches for changes in coding style and functionality.

>* Marks the function as deprecated in pci.h

This is a very good idea in my eyes.

Eike

Attachment: pgpf1TTxJh8sQ.pgp
Description: PGP signature


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