* dtc: Use for_each_marker_of_type in asm_emit_data()
@ 2008-02-28 9:58 David Gibson
0 siblings, 0 replies; only message in thread
From: David Gibson @ 2008-02-28 9:58 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev
For no good reason, asm_emit_data() open-codes the equivalent of the
for_each_marker_of_type macro. Use the macro instead.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
flattree.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
Index: dtc/flattree.c
===================================================================
--- dtc.orig/flattree.c 2008-02-28 20:53:51.000000000 +1100
+++ dtc/flattree.c 2008-02-28 20:56:56.000000000 +1100
@@ -162,14 +162,10 @@
{
FILE *f = e;
int off = 0;
- struct marker *m;
+ struct marker *m = d.markers;
- m = d.markers;
- while (m) {
- if (m->type == LABEL)
- emit_offset_label(f, m->ref, m->offset);
- m = m->next;
- }
+ for_each_marker_of_type(m, LABEL)
+ emit_offset_label(f, m->ref, m->offset);
while ((d.len - off) >= sizeof(u32)) {
fprintf(f, "\t.long\t0x%x\n",
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-28 9:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-28 9:58 dtc: Use for_each_marker_of_type in asm_emit_data() David Gibson
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).