diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-07-13 03:54:39 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2006-07-13 04:43:01 -0400 |
commit | f357b4cc5826ae55a5f3893424502cb15c6b6eba (patch) | |
tree | 39dcb3204ce8e5670863a180deda0c2a9efc9b5c /arch/powerpc/platforms/iseries/vpdinfo.c | |
parent | 06a36db1d712242a00cb30aaebdd088b4be28082 (diff) |
[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: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/powerpc/platforms/iseries/vpdinfo.c')
-rw-r--r-- | arch/powerpc/platforms/iseries/vpdinfo.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/iseries/vpdinfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c index 23a6d1e5b429..ba7f6a62c3bf 100644 --- a/arch/powerpc/platforms/iseries/vpdinfo.c +++ b/arch/powerpc/platforms/iseries/vpdinfo.c | |||
@@ -205,15 +205,16 @@ static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen, | |||
205 | } | 205 | } |
206 | } | 206 | } |
207 | 207 | ||
208 | static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent, | 208 | static int __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent, |
209 | u8 *frame, char card[4]) | 209 | u8 *frame, char card[4]) |
210 | { | 210 | { |
211 | int status = 0; | ||
211 | int BusVpdLen = 0; | 212 | int BusVpdLen = 0; |
212 | u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL); | 213 | u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL); |
213 | 214 | ||
214 | if (BusVpdPtr == NULL) { | 215 | if (BusVpdPtr == NULL) { |
215 | printk("PCI: Bus VPD Buffer allocation failure.\n"); | 216 | printk("PCI: Bus VPD Buffer allocation failure.\n"); |
216 | return; | 217 | return 0; |
217 | } | 218 | } |
218 | BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr), | 219 | BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr), |
219 | BUS_VPDSIZE); | 220 | BUS_VPDSIZE); |
@@ -228,8 +229,10 @@ static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent, | |||
228 | goto out_free; | 229 | goto out_free; |
229 | } | 230 | } |
230 | iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card); | 231 | iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card); |
232 | status = 1; | ||
231 | out_free: | 233 | out_free: |
232 | kfree(BusVpdPtr); | 234 | kfree(BusVpdPtr); |
235 | return status; | ||
233 | } | 236 | } |
234 | 237 | ||
235 | /* | 238 | /* |
@@ -246,7 +249,7 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) | |||
246 | struct device_node *DevNode = PciDev->sysdata; | 249 | struct device_node *DevNode = PciDev->sysdata; |
247 | struct pci_dn *pdn; | 250 | struct pci_dn *pdn; |
248 | u16 bus; | 251 | u16 bus; |
249 | u8 frame; | 252 | u8 frame = 0; |
250 | char card[4]; | 253 | char card[4]; |
251 | HvSubBusNumber subbus; | 254 | HvSubBusNumber subbus; |
252 | HvAgentId agent; | 255 | HvAgentId agent; |
@@ -262,10 +265,11 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) | |||
262 | subbus = pdn->bussubno; | 265 | subbus = pdn->bussubno; |
263 | agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus), | 266 | agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus), |
264 | ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)); | 267 | ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)); |
265 | iSeries_Get_Location_Code(bus, agent, &frame, card); | ||
266 | 268 | ||
267 | printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, Card %4s ", | 269 | if (iSeries_Get_Location_Code(bus, agent, &frame, card)) { |
268 | count, bus, PCI_SLOT(PciDev->devfn), PciDev->vendor, | 270 | printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, " |
269 | frame, card); | 271 | "Card %4s 0x%04X\n", count, bus, |
270 | printk("0x%04X\n", (int)(PciDev->class >> 8)); | 272 | PCI_SLOT(PciDev->devfn), PciDev->vendor, frame, |
273 | card, (int)(PciDev->class >> 8)); | ||
274 | } | ||
271 | } | 275 | } |