Hi Alexander,
Thank you for sending the patch over!
> A single dw_pcie entity can't be a root complex and an endpoint at
> the same time.
Nice catch!
A small nitpick: this would be Root Complex and Endpoint, as it's
customary to capitalise these.
Also, if you could capitalise the subject line - it could also perhaps
be simplified to something like, for example:
Optimize struct dw_pcie to reduce its size
Feel free to ignore both suggestions, as these are just nitpicks.
> We can use this to reduce the size of dw_pcie by 80, from 280 to 200
> bytes (on x32, guess more on x64), by putting the related embedded
> structures (struct pcie_port and struct dw_pcie_ep) into a union.
[...]
> - struct pcie_port pp;
> - struct dw_pcie_ep ep;
> + union {
> + struct pcie_port pp;
> + struct dw_pcie_ep ep;
> + };
[...]
How did you measure the difference? Often, people include pahole output
for the "before" and "after", so to speak, to showcase the difference
and/or improvement. Do you have something like that handy?
Krzysztof