Commit 0f0b56c3 authored by Grant Likely's avatar Grant Likely

of/flattree: eliminate cell_t typedef

A cell is firmly established as a u32.  No need to do an ugly typedef
to redefine it to cell_t.  Eliminate the unnecessary typedef so that
it doesn't have to be added to the of_fdt header file
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Tested-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 83f7a06e
...@@ -42,8 +42,6 @@ ...@@ -42,8 +42,6 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
typedef u32 cell_t;
/* export that to outside world */ /* export that to outside world */
struct device_node *of_chosen; struct device_node *of_chosen;
...@@ -159,7 +157,7 @@ static int __init early_init_dt_scan_memory(unsigned long node, ...@@ -159,7 +157,7 @@ static int __init early_init_dt_scan_memory(unsigned long node,
const char *uname, int depth, void *data) const char *uname, int depth, void *data)
{ {
char *type = of_get_flat_dt_prop(node, "device_type", NULL); char *type = of_get_flat_dt_prop(node, "device_type", NULL);
cell_t *reg, *endp; __be32 *reg, *endp;
unsigned long l; unsigned long l;
/* Look for the ibm,dynamic-reconfiguration-memory node */ /* Look for the ibm,dynamic-reconfiguration-memory node */
...@@ -178,13 +176,13 @@ static int __init early_init_dt_scan_memory(unsigned long node, ...@@ -178,13 +176,13 @@ static int __init early_init_dt_scan_memory(unsigned long node,
} else if (strcmp(type, "memory") != 0) } else if (strcmp(type, "memory") != 0)
return 0; return 0;
reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l); reg = (__be32 *)of_get_flat_dt_prop(node, "linux,usable-memory", &l);
if (reg == NULL) if (reg == NULL)
reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l); reg = (__be32 *)of_get_flat_dt_prop(node, "reg", &l);
if (reg == NULL) if (reg == NULL)
return 0; return 0;
endp = reg + (l / sizeof(cell_t)); endp = reg + (l / sizeof(__be32));
pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n", pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
uname, l, reg[0], reg[1], reg[2], reg[3]); uname, l, reg[0], reg[1], reg[2], reg[3]);
......
...@@ -67,8 +67,6 @@ int __initdata iommu_force_on; ...@@ -67,8 +67,6 @@ int __initdata iommu_force_on;
unsigned long tce_alloc_start, tce_alloc_end; unsigned long tce_alloc_start, tce_alloc_end;
#endif #endif
typedef u32 cell_t;
extern rwlock_t devtree_lock; /* temporary while merging */ extern rwlock_t devtree_lock; /* temporary while merging */
/* export that to outside world */ /* export that to outside world */
...@@ -441,22 +439,22 @@ static int __init early_init_dt_scan_chosen(unsigned long node, ...@@ -441,22 +439,22 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
*/ */
static int __init early_init_dt_scan_drconf_memory(unsigned long node) static int __init early_init_dt_scan_drconf_memory(unsigned long node)
{ {
cell_t *dm, *ls, *usm; __be32 *dm, *ls, *usm;
unsigned long l, n, flags; unsigned long l, n, flags;
u64 base, size, lmb_size; u64 base, size, lmb_size;
unsigned int is_kexec_kdump = 0, rngs; unsigned int is_kexec_kdump = 0, rngs;
ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l); ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l);
if (ls == NULL || l < dt_root_size_cells * sizeof(cell_t)) if (ls == NULL || l < dt_root_size_cells * sizeof(__be32))
return 0; return 0;
lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls); lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls);
dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l); dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l);
if (dm == NULL || l < sizeof(cell_t)) if (dm == NULL || l < sizeof(__be32))
return 0; return 0;
n = *dm++; /* number of entries */ n = *dm++; /* number of entries */
if (l < (n * (dt_root_addr_cells + 4) + 1) * sizeof(cell_t)) if (l < (n * (dt_root_addr_cells + 4) + 1) * sizeof(__be32))
return 0; return 0;
/* check if this is a kexec/kdump kernel. */ /* check if this is a kexec/kdump kernel. */
...@@ -515,7 +513,7 @@ static int __init early_init_dt_scan_memory(unsigned long node, ...@@ -515,7 +513,7 @@ static int __init early_init_dt_scan_memory(unsigned long node,
const char *uname, int depth, void *data) const char *uname, int depth, void *data)
{ {
char *type = of_get_flat_dt_prop(node, "device_type", NULL); char *type = of_get_flat_dt_prop(node, "device_type", NULL);
cell_t *reg, *endp; __be32 *reg, *endp;
unsigned long l; unsigned long l;
/* Look for the ibm,dynamic-reconfiguration-memory node */ /* Look for the ibm,dynamic-reconfiguration-memory node */
...@@ -540,7 +538,7 @@ static int __init early_init_dt_scan_memory(unsigned long node, ...@@ -540,7 +538,7 @@ static int __init early_init_dt_scan_memory(unsigned long node,
if (reg == NULL) if (reg == NULL)
return 0; return 0;
endp = reg + (l / sizeof(cell_t)); endp = reg + (l / sizeof(__be32));
DBG("memory scan node %s, reg size %ld, data: %x %x %x %x,\n", DBG("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
uname, l, reg[0], reg[1], reg[2], reg[3]); uname, l, reg[0], reg[1], reg[2], reg[3]);
......
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