PCI: hv: Fix wslot_to_devfn() to fix warnings on device removal

am: bc5338a4fd

Change-Id: I5e0427ff5a79b26eaf0d4506bf94d084fae90862
This commit is contained in:
Dexuan Cui
2017-03-12 08:23:36 +00:00
committed by android-build-merger

View File

@@ -130,7 +130,8 @@ union pci_version {
*/
union win_slot_encoding {
struct {
u32 func:8;
u32 dev:5;
u32 func:3;
u32 reserved:24;
} bits;
u32 slot;
@@ -483,7 +484,8 @@ static u32 devfn_to_wslot(int devfn)
union win_slot_encoding wslot;
wslot.slot = 0;
wslot.bits.func = PCI_SLOT(devfn) | (PCI_FUNC(devfn) << 5);
wslot.bits.dev = PCI_SLOT(devfn);
wslot.bits.func = PCI_FUNC(devfn);
return wslot.slot;
}
@@ -501,7 +503,7 @@ static int wslot_to_devfn(u32 wslot)
union win_slot_encoding slot_no;
slot_no.slot = wslot;
return PCI_DEVFN(0, slot_no.bits.func);
return PCI_DEVFN(slot_no.bits.dev, slot_no.bits.func);
}
/*