linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c
@ 2006-07-13  7:54 Michael Ellerman
  2006-07-13  7:54 ` [PATCH 2/3] Fix a compiler warning in mm/tlb_64.c Michael Ellerman
  2006-07-13  7:54 ` [PATCH 3/3] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Ellerman @ 2006-07-13  7:54 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev

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>
---

 arch/powerpc/platforms/iseries/vpdinfo.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

Index: to-merge/arch/powerpc/platforms/iseries/vpdinfo.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/iseries/vpdinfo.c
+++ to-merge/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -205,15 +205,16 @@ static void __init iSeries_Parse_Vpd(u8 
 	}
 }
 
-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])
 {
+	int status = 0;
 	int BusVpdLen = 0;
 	u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
 
 	if (BusVpdPtr == NULL) {
 		printk("PCI: Bus VPD Buffer allocation failure.\n");
-		return;
+		return 0;
 	}
 	BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr),
 					BUS_VPDSIZE);
@@ -228,8 +229,10 @@ static void __init iSeries_Get_Location_
 		goto out_free;
 	}
 	iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card);
+	status = 1;
 out_free:
 	kfree(BusVpdPtr);
+	return status;
 }
 
 /*
@@ -246,7 +249,7 @@ void __init iSeries_Device_Information(s
 	struct device_node *DevNode = PciDev->sysdata;
 	struct pci_dn *pdn;
 	u16 bus;
-	u8 frame;
+	u8 frame = 0;
 	char card[4];
 	HvSubBusNumber subbus;
 	HvAgentId agent;
@@ -262,10 +265,11 @@ void __init iSeries_Device_Information(s
 	subbus = pdn->bussubno;
 	agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_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  ",
-			count, bus, PCI_SLOT(PciDev->devfn), PciDev->vendor,
-			frame, card);
-	printk("0x%04X\n", (int)(PciDev->class >> 8));
+	if (iSeries_Get_Location_Code(bus, agent, &frame, card)) {
+		printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, "
+			"Card %4s  0x%04X\n", count, bus,
+			PCI_SLOT(PciDev->devfn), PciDev->vendor, frame,
+			card, (int)(PciDev->class >> 8));
+	}
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/3] Fix a compiler warning in mm/tlb_64.c
  2006-07-13  7:54 [PATCH 1/3] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c Michael Ellerman
@ 2006-07-13  7:54 ` Michael Ellerman
  2006-07-13  7:54 ` [PATCH 3/3] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2006-07-13  7:54 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev

The compiler doesn't understand that BUG() never returns, so complains that
psize isn't set. Just set it to the normal value, which seems to produce nice
code and keeps gcc happy.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/mm/tlb_64.c |    1 +
 1 file changed, 1 insertion(+)

Index: to-merge/arch/powerpc/mm/tlb_64.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/tlb_64.c
+++ to-merge/arch/powerpc/mm/tlb_64.c
@@ -146,6 +146,7 @@ void hpte_update(struct mm_struct *mm, u
 		psize = mmu_huge_psize;
 #else
 		BUG();
+		psize = pte_pagesize_index(pte); /* shutup gcc */
 #endif
 	} else
 		psize = pte_pagesize_index(pte);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3/3] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c
  2006-07-13  7:54 [PATCH 1/3] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c Michael Ellerman
  2006-07-13  7:54 ` [PATCH 2/3] Fix a compiler warning in mm/tlb_64.c Michael Ellerman
@ 2006-07-13  7:54 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2006-07-13  7:54 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev

PhbId might be used unitialised, so set it to 0xff (nothing) always.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/platforms/iseries/vpdinfo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: to-merge/arch/powerpc/platforms/iseries/vpdinfo.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/iseries/vpdinfo.c
+++ to-merge/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -188,7 +188,7 @@ static void __init iSeries_Parse_Vpd(u8 
 {
 	u8 *TagPtr = VpdData;
 	int DataLen = VpdDataLen - 3;
-	u8 PhbId;
+	u8 PhbId = 0xff;
 
 	while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) {
 		int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-13  7:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-13  7:54 [PATCH 1/3] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c Michael Ellerman
2006-07-13  7:54 ` [PATCH 2/3] Fix a compiler warning in mm/tlb_64.c Michael Ellerman
2006-07-13  7:54 ` [PATCH 3/3] iseries: Fix a compiler warning in platforms/iseries/vpdinfo.c Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).