pcie-mediatek slot calculation correct?

From: Ilpo Järvinen
Date: Mon Apr 29 2024 - 06:23:07 EST


Hi all,

I was doing Conf Type 0/1 helper generalization when I ran into this code
in drivers/pci/controller/pcie-mediatek.c:

u32 func = PCI_FUNC(port->slot);
u32 slot = PCI_SLOT(port->slot << 3);

With that code, function is effectively duplicated into slot, is this
correct behavior?

..Adjustments made in the history of this code fragment didn't exactly
inspire confidence on the correctness of this code. :-/


--
i.