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

Linus Torvalds (torvalds@transmeta.com)
Mon, 26 Aug 2002 10:42:34 -0700 (PDT)


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/