Skip to contentSkip to conversation

Fix LMB type issues

PATCH New Andy Fleming 2 participants 2 messages Jul 7, 2008 – Jul 9, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix LMB type issues

The LMB code now uses phys_addr_t and phys_size_t. Also, there were a couple of casting problems in the bootm code that called the LMB functions.

---
 include/lmb.h     |    2 +-
 lib_generic/lmb.c |    6 +++---
 lib_ppc/bootm.c   |    5 +++--
 3 files changed, 7 insertions(+), 6 deletions(-)
include/lmb.h +1 -1
index 0283075..14e8727 100644
@@ -43,7 +43,7 @@ extern phys_addr_t lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align
 extern phys_addr_t __lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align,
 			      phys_addr_t max_addr);
 extern int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr);
-extern long lmb_free(struct lmb *lmb, u64 base, u64 size);
+extern long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size);
 
 extern void lmb_dump_all(struct lmb *lmb);
 
lib_generic/lmb.c +3 -3
index 93264c1..6b46fa8 100644
@@ -181,11 +181,11 @@ long lmb_add(struct lmb *lmb, phys_addr_t base, phys_size_t size)
 	return lmb_add_region(_rgn, base, size);
 }
 
-long lmb_free(struct lmb *lmb, u64 base, u64 size)
+long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size)
 {
 	struct lmb_region *rgn = &(lmb->reserved);
-	u64 rgnbegin, rgnend;
-	u64 end = base + size;
+	phys_addr_t rgnbegin, rgnend;
+	phys_addr_t end = base + size;
 	int i;
 
 	rgnbegin = rgnend = 0; /* supress gcc warnings */
lib_ppc/bootm.c +3 -2
index 3c1c18b..677ec62 100644
@@ -205,14 +205,15 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
 		for (j = 0; j < total; j++) {
 			fdt_get_mem_rsv(of_flat_tree, j, &addr, &size);
-			if (addr == (uint64_t)of_flat_tree) {
+			if (addr == (uint64_t)(ulong)of_flat_tree) {
 				fdt_del_mem_rsv(of_flat_tree, j);
 				break;
 			}
 		}
 
 		/* Delete the old LMB reservation */
-		lmb_free(lmb, (uint64_t)of_flat_tree, fdt_totalsize(of_flat_tree));
+		lmb_free(lmb, (phys_addr_t)(ulong)of_flat_tree,
+				(phys_size_t)fdt_totalsize(of_flat_tree));
 
 		/* Calculate the actual size of the fdt */
 		actualsize = fdt_off_dt_strings(of_flat_tree) +
Signature · 1 line
1.5.4.GIT
#1 lore raw

PATCH 1/1 Fix LMB type issues

Quoted 9 lines · In message <[email protected]> you wrote:

The LMB code now uses phys_addr_t and phys_size_t. Also, there were a couple of casting problems in the bootm code that called the LMB functions.

---
 include/lmb.h     |    2 +-
 lib_generic/lmb.c |    6 +++---
 lib_ppc/bootm.c   |    5 +++--
 3 files changed, 7 insertions(+), 6 deletions(-)

Applid (with conflicts - please check result). Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Hegel was right when he said that we learn from history that man  can
never learn anything from history.              - George Bernard Shaw