diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2009-12-11 01:42:17 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-12-11 01:42:17 -0500 |
commit | 0f0b56c3f2df4a083fc9e934266e5bab1710e286 (patch) | |
tree | 8e40c58c5eaae83d68eba6c31a93ff9c5414800a /arch | |
parent | 83f7a06eb479e2aeb83536e77a2cb14cc2285e32 (diff) |
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: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/kernel/prom.c | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 14 |
2 files changed, 10 insertions, 14 deletions
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c index e0f4c34ed0f2..50d8b09d5e3f 100644 --- a/arch/microblaze/kernel/prom.c +++ b/arch/microblaze/kernel/prom.c | |||
@@ -42,8 +42,6 @@ | |||
42 | #include <asm/sections.h> | 42 | #include <asm/sections.h> |
43 | #include <asm/pci-bridge.h> | 43 | #include <asm/pci-bridge.h> |
44 | 44 | ||
45 | typedef u32 cell_t; | ||
46 | |||
47 | /* export that to outside world */ | 45 | /* export that to outside world */ |
48 | struct device_node *of_chosen; | 46 | struct device_node *of_chosen; |
49 | 47 | ||
@@ -159,7 +157,7 @@ static int __init early_init_dt_scan_memory(unsigned long node, | |||
159 | const char *uname, int depth, void *data) | 157 | const char *uname, int depth, void *data) |
160 | { | 158 | { |
161 | char *type = of_get_flat_dt_prop(node, "device_type", NULL); | 159 | char *type = of_get_flat_dt_prop(node, "device_type", NULL); |
162 | cell_t *reg, *endp; | 160 | __be32 *reg, *endp; |
163 | unsigned long l; | 161 | unsigned long l; |
164 | 162 | ||
165 | /* Look for the ibm,dynamic-reconfiguration-memory node */ | 163 | /* Look for the ibm,dynamic-reconfiguration-memory node */ |
@@ -178,13 +176,13 @@ static int __init early_init_dt_scan_memory(unsigned long node, | |||
178 | } else if (strcmp(type, "memory") != 0) | 176 | } else if (strcmp(type, "memory") != 0) |
179 | return 0; | 177 | return 0; |
180 | 178 | ||
181 | reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l); | 179 | reg = (__be32 *)of_get_flat_dt_prop(node, "linux,usable-memory", &l); |
182 | if (reg == NULL) | 180 | if (reg == NULL) |
183 | reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l); | 181 | reg = (__be32 *)of_get_flat_dt_prop(node, "reg", &l); |
184 | if (reg == NULL) | 182 | if (reg == NULL) |
185 | return 0; | 183 | return 0; |
186 | 184 | ||
187 | endp = reg + (l / sizeof(cell_t)); | 185 | endp = reg + (l / sizeof(__be32)); |
188 | 186 | ||
189 | pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n", | 187 | pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n", |
190 | uname, l, reg[0], reg[1], reg[2], reg[3]); | 188 | uname, l, reg[0], reg[1], reg[2], reg[3]); |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 048e3a3e9876..4e3181cded44 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -67,8 +67,6 @@ int __initdata iommu_force_on; | |||
67 | unsigned long tce_alloc_start, tce_alloc_end; | 67 | unsigned long tce_alloc_start, tce_alloc_end; |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | typedef u32 cell_t; | ||
71 | |||
72 | extern rwlock_t devtree_lock; /* temporary while merging */ | 70 | extern rwlock_t devtree_lock; /* temporary while merging */ |
73 | 71 | ||
74 | /* export that to outside world */ | 72 | /* export that to outside world */ |
@@ -441,22 +439,22 @@ static int __init early_init_dt_scan_chosen(unsigned long node, | |||
441 | */ | 439 | */ |
442 | static int __init early_init_dt_scan_drconf_memory(unsigned long node) | 440 | static int __init early_init_dt_scan_drconf_memory(unsigned long node) |
443 | { | 441 | { |
444 | cell_t *dm, *ls, *usm; | 442 | __be32 *dm, *ls, *usm; |
445 | unsigned long l, n, flags; | 443 | unsigned long l, n, flags; |
446 | u64 base, size, lmb_size; | 444 | u64 base, size, lmb_size; |
447 | unsigned int is_kexec_kdump = 0, rngs; | 445 | unsigned int is_kexec_kdump = 0, rngs; |
448 | 446 | ||
449 | ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l); | 447 | ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l); |
450 | if (ls == NULL || l < dt_root_size_cells * sizeof(cell_t)) | 448 | if (ls == NULL || l < dt_root_size_cells * sizeof(__be32)) |
451 | return 0; | 449 | return 0; |
452 | lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls); | 450 | lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls); |
453 | 451 | ||
454 | dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l); | 452 | dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l); |
455 | if (dm == NULL || l < sizeof(cell_t)) | 453 | if (dm == NULL || l < sizeof(__be32)) |
456 | return 0; | 454 | return 0; |
457 | 455 | ||
458 | n = *dm++; /* number of entries */ | 456 | n = *dm++; /* number of entries */ |
459 | if (l < (n * (dt_root_addr_cells + 4) + 1) * sizeof(cell_t)) | 457 | if (l < (n * (dt_root_addr_cells + 4) + 1) * sizeof(__be32)) |
460 | return 0; | 458 | return 0; |
461 | 459 | ||
462 | /* check if this is a kexec/kdump kernel. */ | 460 | /* check if this is a kexec/kdump kernel. */ |
@@ -515,7 +513,7 @@ static int __init early_init_dt_scan_memory(unsigned long node, | |||
515 | const char *uname, int depth, void *data) | 513 | const char *uname, int depth, void *data) |
516 | { | 514 | { |
517 | char *type = of_get_flat_dt_prop(node, "device_type", NULL); | 515 | char *type = of_get_flat_dt_prop(node, "device_type", NULL); |
518 | cell_t *reg, *endp; | 516 | __be32 *reg, *endp; |
519 | unsigned long l; | 517 | unsigned long l; |
520 | 518 | ||
521 | /* Look for the ibm,dynamic-reconfiguration-memory node */ | 519 | /* Look for the ibm,dynamic-reconfiguration-memory node */ |
@@ -540,7 +538,7 @@ static int __init early_init_dt_scan_memory(unsigned long node, | |||
540 | if (reg == NULL) | 538 | if (reg == NULL) |
541 | return 0; | 539 | return 0; |
542 | 540 | ||
543 | endp = reg + (l / sizeof(cell_t)); | 541 | endp = reg + (l / sizeof(__be32)); |
544 | 542 | ||
545 | DBG("memory scan node %s, reg size %ld, data: %x %x %x %x,\n", | 543 | DBG("memory scan node %s, reg size %ld, data: %x %x %x %x,\n", |
546 | uname, l, reg[0], reg[1], reg[2], reg[3]); | 544 | uname, l, reg[0], reg[1], reg[2], reg[3]); |