Re: [patch 2.5.31] transparent PCI-to-PCI bridges

Linus Torvalds
2002-08-26T17:36:41Z

On Mon, 26 Aug 2002, Ivan Kokshaysky wrote:
>
> Ok. Updated patch appended.

Please don't do it like this: I hate code that changes standard PCI data
structure meaning (in this case the "class" thing) behind peoples back..
Some other user might well want to look at the original class member, and
rewriting it to a magic value just to make the transparency check pass
sounds like a bad idea to me.

So instead, I would suggest that you add a single-bit "transparent" field
to the PCI structure, and initialize it to "(class & 0xff) == 1" when
initializing the device data. Then, any fixup can just set the transparent
bit to 1.

That would make the code more robust, and more readable in my opionion.

Ok?

Linus