Commit f357b4cc authored by Michael Ellerman's avatar Michael Ellerman Committed by Stephen Rothwell

[POWERPC] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c

iSeries_Get_Location_Code() has error paths, but currently returns void, so
give it a return code and only print the output if it returns successfully.
Gcc isn't smart enough to be quiet though, so set frame to 0 to shut it up.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
parent 06a36db1
...@@ -205,15 +205,16 @@ static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen, ...@@ -205,15 +205,16 @@ static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
} }
} }
static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent, static int __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
u8 *frame, char card[4]) u8 *frame, char card[4])
{ {
int status = 0;
int BusVpdLen = 0; int BusVpdLen = 0;
u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL); u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
if (BusVpdPtr == NULL) { if (BusVpdPtr == NULL) {
printk("PCI: Bus VPD Buffer allocation failure.\n"); printk("PCI: Bus VPD Buffer allocation failure.\n");
return; return 0;
} }
BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr), BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr),
BUS_VPDSIZE); BUS_VPDSIZE);
...@@ -228,8 +229,10 @@ static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent, ...@@ -228,8 +229,10 @@ static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
goto out_free; goto out_free;
} }
iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card); iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card);
status = 1;
out_free: out_free:
kfree(BusVpdPtr); kfree(BusVpdPtr);
return status;
} }
/* /*
...@@ -246,7 +249,7 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) ...@@ -246,7 +249,7 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
struct device_node *DevNode = PciDev->sysdata; struct device_node *DevNode = PciDev->sysdata;
struct pci_dn *pdn; struct pci_dn *pdn;
u16 bus; u16 bus;
u8 frame; u8 frame = 0;
char card[4]; char card[4];
HvSubBusNumber subbus; HvSubBusNumber subbus;
HvAgentId agent; HvAgentId agent;
...@@ -262,10 +265,11 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) ...@@ -262,10 +265,11 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
subbus = pdn->bussubno; subbus = pdn->bussubno;
agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus), agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)); ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
iSeries_Get_Location_Code(bus, agent, &frame, card);
printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, Card %4s ", if (iSeries_Get_Location_Code(bus, agent, &frame, card)) {
count, bus, PCI_SLOT(PciDev->devfn), PciDev->vendor, printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, "
frame, card); "Card %4s 0x%04X\n", count, bus,
printk("0x%04X\n", (int)(PciDev->class >> 8)); PCI_SLOT(PciDev->devfn), PciDev->vendor, frame,
card, (int)(PciDev->class >> 8));
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment