aboutsummaryrefslogtreecommitdiff
path: root/treesource.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2021-07-27 12:30:19 -0600
committerDavid Gibson <david@gibson.dropbear.id.au>2021-09-25 16:11:41 +1000
commitff3a30c115ad7354689dc7858604356ecb7f9b1c (patch)
treebf9715256abd733baa9314d1a35a853df9255646 /treesource.c
parent5eb5927d81ee6036f45c4e1bd89ae66ed325d721 (diff)
downloaddtc-ff3a30c115ad7354689dc7858604356ecb7f9b1c.zip
dtc-ff3a30c115ad7354689dc7858604356ecb7f9b1c.tar.gz
dtc-ff3a30c115ad7354689dc7858604356ecb7f9b1c.tar.bz2
asm: Use .asciz and .ascii instead of .string
We use the .string pseudo-op both in some of our test assembly files and in our -Oasm output. We expect this to emit a \0 terminated string into the .o file. However for certain targets (e.g. HP PA-RISC) it doesn't include the \0. Use .asciz instead, which explicitly does what we want. There's also one place we can use .ascii (which explicitly emits a string *without* \0 termination) instead of multiple .byte directives. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'treesource.c')
-rw-r--r--treesource.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/treesource.c b/treesource.c
index 061ba8c..db2ff69 100644
--- a/treesource.c
+++ b/treesource.c
@@ -124,27 +124,6 @@ static void write_propval_int(FILE *f, const char *p, size_t len, size_t width)
}
}
-static bool has_data_type_information(struct marker *m)
-{
- return m->type >= TYPE_UINT8;
-}
-
-static struct marker *next_type_marker(struct marker *m)
-{
- while (m && !has_data_type_information(m))
- m = m->next;
- return m;
-}
-
-size_t type_marker_length(struct marker *m)
-{
- struct marker *next = next_type_marker(m->next);
-
- if (next)
- return next->offset - m->offset;
- return 0;
-}
-
static const char *delim_start[] = {
[TYPE_UINT8] = "[",
[TYPE_UINT16] = "/bits/ 16 <",
@@ -230,7 +209,7 @@ static void write_propval(FILE *f, struct property *prop)
size_t data_len = type_marker_length(m) ? : len - m->offset;
const char *p = &prop->val.val[m->offset];
- if (has_data_type_information(m)) {
+ if (is_type_marker(m->type)) {
emit_type = m->type;
fprintf(f, " %s", delim_start[emit_type]);
} else if (m->type == LABEL)