linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/20] [powerpc,iseries] Constify & voidify get_property()
@ 2006-07-04  6:46 Jeremy Kerr
  0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Kerr @ 2006-07-04  6:46 UTC (permalink / raw)
  To: linuxppc-dev

Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

iseries platform changes.

Built for iseries_defconfig

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---

 iommu.c |    2 +-
 pci.c   |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

Index: linux-2.6/arch/powerpc/platforms/iseries/iommu.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/iseries/iommu.c
+++ linux-2.6/arch/powerpc/platforms/iseries/iommu.c
@@ -162,7 +162,7 @@ void iommu_devnode_init_iSeries(struct d
 {
 	struct iommu_table *tbl;
 	struct pci_dn *pdn = PCI_DN(dn);
-	u32 *lsn = (u32 *)get_property(dn, "linux,logical-slot-number", NULL);
+	const u32 *lsn = get_property(dn, "linux,logical-slot-number", NULL);
 
 	BUG_ON(lsn == NULL);
 
Index: linux-2.6/arch/powerpc/platforms/iseries/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/iseries/pci.c
+++ linux-2.6/arch/powerpc/platforms/iseries/pci.c
@@ -176,12 +176,12 @@ void iSeries_pcibios_init(void)
 	}
 	while ((node = of_get_next_child(root, node)) != NULL) {
 		HvBusNumber bus;
-		u32 *busp;
+		const u32 *busp;
 
 		if ((node->type == NULL) || (strcmp(node->type, "pci") != 0))
 			continue;
 
-		busp = (u32 *)get_property(node, "bus-range", NULL);
+		busp = get_property(node, "bus-range", NULL);
 		if (busp == NULL)
 			continue;
 		bus = *busp;
@@ -221,10 +221,9 @@ void __init iSeries_pci_final_fixup(void
 
 		if (node != NULL) {
 			struct pci_dn *pdn = PCI_DN(node);
-			u32 *agent;
+			const u32 *agent;
 
-			agent = (u32 *)get_property(node, "linux,agent-id",
-					NULL);
+			agent = get_property(node, "linux,agent-id", NULL);
 			if ((pdn != NULL) && (agent != NULL)) {
 				u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
 						pdn->bussubno);

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

* Re: [PATCH 7/20] [powerpc,iseries] Constify & voidify get_property()
@ 2006-07-04  6:58 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2006-07-04  6:58 UTC (permalink / raw)
  To: Jeremy Kerr; +Cc: linuxppc-dev

On Tue,  4 Jul 2006 16:46:44 +1000 (EST) Jeremy Kerr <jk@ozlabs.org> wrote:
>
> Now that get_property() returns a void *, there's no need to cast its
> return value. Also, treat the return value as const, so we can
> constify get_property later.
> 
> iseries platform changes.
> 
> Built for iseries_defconfig
> 
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

end of thread, other threads:[~2006-07-04  6:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-04  6:46 [PATCH 7/20] [powerpc,iseries] Constify & voidify get_property() Jeremy Kerr
  -- strict thread matches above, loose matches on Subject: below --
2006-07-04  6:58 Stephen Rothwell

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