2005-09-11 03:12:24

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 2.6.13-rc4 1/1] pci_ids: patch for Intel ICH7R

On Sat, Jul 30, 2005 at 02:54:17PM +1000, Grant Coady wrote:
> On Fri, 29 Jul 2005 23:52:39 -0400, Jeff Garzik <[email protected]> wrote:
> >
> >However you did your search, you did it wrong. The very first two
> >entries I tried had zero uses:
> >
> >[jgarzik@pretzel linux-2.6]$ grepsrc ICH7_22
> >./include/linux/pci_ids.h:#define PCI_DEVICE_ID_INTEL_ICH7_22 0x27e0
> >[jgarzik@pretzel linux-2.6]$ grepsrc ICH7_23
> >./include/linux/pci_ids.h:#define PCI_DEVICE_ID_INTEL_ICH7_23 0x27e2
> >[jgarzik@pretzel linux-2.6]$
>
> Sorry Jeff, excluding "include/linux/pci_ids.h" makes a huge difference :o)
>
> Does roughly 1/3 unused:
>
> 63065 2005-07-30 14:51 pci_ids-list
> 19243 2005-07-30 14:52 pci_ids-not_used
>
> Seem in ballpark?

Great, care to send me a patch that trims this file down?

thanks,

greg k-h


2005-09-11 08:01:37

by Grant Coady

[permalink] [raw]
Subject: Re: [PATCH 2.6.13-rc4 1/1] pci_ids: patch for Intel ICH7R

On Sat, 10 Sep 2005 20:11:50 -0700, Greg KH <[email protected]> wrote:

>On Sat, Jul 30, 2005 at 02:54:17PM +1000, Grant Coady wrote:
>> On Fri, 29 Jul 2005 23:52:39 -0400, Jeff Garzik <[email protected]> wrote:
>> >
>> >However you did your search, you did it wrong. The very first two
>> >entries I tried had zero uses:
>> >
>> >[jgarzik@pretzel linux-2.6]$ grepsrc ICH7_22
>> >./include/linux/pci_ids.h:#define PCI_DEVICE_ID_INTEL_ICH7_22 0x27e0
>> >[jgarzik@pretzel linux-2.6]$ grepsrc ICH7_23
>> >./include/linux/pci_ids.h:#define PCI_DEVICE_ID_INTEL_ICH7_23 0x27e2
>> >[jgarzik@pretzel linux-2.6]$
>>
>> Sorry Jeff, excluding "include/linux/pci_ids.h" makes a huge difference :o)
>>
>> Does roughly 1/3 unused:
>>
>> 63065 2005-07-30 14:51 pci_ids-list
>> 19243 2005-07-30 14:52 pci_ids-not_used
>>
>> Seem in ballpark?
>
>Great, care to send me a patch that trims this file down?

Just ran the discovery script on 2.6.13.mm2, there's roughly 1609
symbols unused in pci_ids.h, another 1030 are defined throughout the
source tree, leaving 729 in pci_ids.h. Total unique symbols is 1030.
Not counted are macro defined symbols:

PCI_DEVICE_ID_##id
PCI_DEVICE_ID_##v##_##d
PCI_DEVICE_ID_BROOKTREE_##chip
PCI_VENDOR_ID_##v

from:

linux-2.6.13-mm2/drivers/video/cirrusfb.c
linux-2.6.13-mm2/sound/oss/ymfpci.c
linux-2.6.13-mm2/sound/pci/bt87x.c


What is the goal here? Is a comment stripped, non-duplicate pci_ids.h
with a reference to source site okay?

Should the various distributed defines be collected to the one header
file and that header be include'd to those files? It seems pci_ids.h
is redundant.

Thanks,
Grant.

2005-09-11 08:51:28

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 2.6.13-rc4 1/1] pci_ids: patch for Intel ICH7R

Grant Coady wrote:
> Just ran the discovery script on 2.6.13.mm2, there's roughly 1609
> symbols unused in pci_ids.h, another 1030 are defined throughout the
> source tree, leaving 729 in pci_ids.h. Total unique symbols is 1030.
> Not counted are macro defined symbols:
>
> PCI_DEVICE_ID_##id
> PCI_DEVICE_ID_##v##_##d
> PCI_DEVICE_ID_BROOKTREE_##chip
> PCI_VENDOR_ID_##v
>
> from:
>
> linux-2.6.13-mm2/drivers/video/cirrusfb.c
> linux-2.6.13-mm2/sound/oss/ymfpci.c
> linux-2.6.13-mm2/sound/pci/bt87x.c
>
>
> What is the goal here? Is a comment stripped, non-duplicate pci_ids.h
> with a reference to source site okay?

Not sure what your last question is asking. The current goal is to
remove completely unused symbols from pci_ids.h, nothing more.


> Should the various distributed defines be collected to the one header
> file and that header be include'd to those files? It seems pci_ids.h
> is redundant.

pci_ids.h should be the place where PCI IDs (class, vendor, device) are
collected.

Long term, we should be able to trim a lot of device ids, since they are
usually only used in one place.

Jeff


2005-09-11 20:40:32

by Grant Coady

[permalink] [raw]
Subject: Re: [PATCH 2.6.13-rc4 1/1] pci_ids: patch for Intel ICH7R

On Sun, 11 Sep 2005 04:51:10 -0400, Jeff Garzik <[email protected]> wrote:

>Grant Coady wrote:
>> Just ran the discovery script on 2.6.13.mm2, there's roughly 1609
>> symbols unused in pci_ids.h, another 1030 are defined throughout the
>> source tree, leaving 729 in pci_ids.h. Total unique symbols is 1030.
>> Not counted are macro defined symbols:
>>
>> PCI_DEVICE_ID_##id
>> PCI_DEVICE_ID_##v##_##d
>> PCI_DEVICE_ID_BROOKTREE_##chip
>> PCI_VENDOR_ID_##v
>>
>> from:
>>
>> linux-2.6.13-mm2/drivers/video/cirrusfb.c
>> linux-2.6.13-mm2/sound/oss/ymfpci.c
>> linux-2.6.13-mm2/sound/pci/bt87x.c
>>
>>
>> What is the goal here? Is a comment stripped, non-duplicate pci_ids.h
>> with a reference to source site okay?
>
>Not sure what your last question is asking. The current goal is to
>remove completely unused symbols from pci_ids.h, nothing more.

Okay, ignore this part, I was thinking something else.
>
>
>> Should the various distributed defines be collected to the one header
>> file and that header be include'd to those files? It seems pci_ids.h
>> is redundant.
>
>pci_ids.h should be the place where PCI IDs (class, vendor, device) are
>collected.

Okay.
>
>Long term, we should be able to trim a lot of device ids, since they are
>usually only used in one place.

Okay, dunno when, need to fix script and test some more, it's eating
live symbols :( Long time since I looked at this area.

Grant.

2005-09-13 06:47:13

by Grant

[permalink] [raw]
Subject: Re: [PATCH 2.6.13-rc4 1/1] pci_ids: patch for Intel ICH7R

On Sun, 11 Sep 2005 04:51:10 -0400, Jeff Garzik <[email protected]> wrote:
>
>pci_ids.h should be the place where PCI IDs (class, vendor, device) are
>collected.

Few files reference it.
>
>Long term, we should be able to trim a lot of device ids, since they are
>usually only used in one place.

Well, they're not, and trimming a file marked for removal is pointless.

Grant.

2005-09-13 07:05:33

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 2.6.13-rc4 1/1] pci_ids: patch for Intel ICH7R

On Tue, Sep 13, 2005 at 04:46:45PM +1000, Grant wrote:
> On Sun, 11 Sep 2005 04:51:10 -0400, Jeff Garzik <[email protected]> wrote:
> >
> >pci_ids.h should be the place where PCI IDs (class, vendor, device) are
> >collected.
>
> Few files reference it.

include/pci.h does, so pretty much every pci driver does because of
that.

> >Long term, we should be able to trim a lot of device ids, since they are
> >usually only used in one place.
>
> Well, they're not, and trimming a file marked for removal is pointless.

Huh? That file isn't marked for removal, that was the id database,
which is now gone...

thanks,

greg k-h

2005-09-13 08:15:09

by Grant Coady

[permalink] [raw]
Subject: Re: [PATCH 2.6.13-rc4 1/1] pci_ids: patch for Intel ICH7R

On Tue, 13 Sep 2005 00:03:24 -0700, Greg KH <[email protected]> wrote:

>On Tue, Sep 13, 2005 at 04:46:45PM +1000, Grant wrote:
>> On Sun, 11 Sep 2005 04:51:10 -0400, Jeff Garzik <[email protected]> wrote:
>> >
>> >pci_ids.h should be the place where PCI IDs (class, vendor, device) are
>> >collected.
>>
>> Few files reference it.
>
>include/pci.h does, so pretty much every pci driver does because of
>that.

That's probably the little aspect I missed :) Something wasn't making
sense to me.
>
>> >Long term, we should be able to trim a lot of device ids, since they are
>> >usually only used in one place.
>>
>> Well, they're not, and trimming a file marked for removal is pointless.
>
>Huh? That file isn't marked for removal, that was the id database,
>which is now gone...

Ahh, that explains my confusion, I'll have another look at it.

Grant.

2005-11-02 05:38:42

by Grant Coady

[permalink] [raw]
Subject: Re: [PATCH 2.6.13-rc4 1/1] pci_ids: patch for Intel ICH7R

Jeff Garzik wrote:
>
> pci_ids.h should be the place where PCI IDs (class, vendor, device) are
> collected.
>
> Long term, we should be able to trim a lot of device ids, since they are
> usually only used in one place.
>
These two sentences seem mutually exclusive to me, you want pci_ids collected
in the header file, _and_ then trim single use IDs from which: the header,
or the source.c file defining them? Present usage is ~50/50, which way to
go?

Grant.