Skip to contentSkip to conversation

Revert "yamltree: Ensure consistent bracketing of properties with phandles"

PATCH Applied Rob Herring 2 participants 2 messages Jan 24, 2020 – Jan 29, 2020 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "yamltree: Ensure consistent bracketing of properties with phandles"

This reverts commit 18d7b2f4ee45fec422b7d82bab0b3c762ee907e4.

This doesn't work for properties such as 'interrupt-map' that has phandle in the middle of an entry. It would also not work for a 0 or -1 phandle value that acts as a NULL.

---
 yamltree.c | 21 ---------------------
 1 file changed, 21 deletions(-)
yamltree.c +0 -21
index 43ca869dd6a8..5b6ea8ea862f 100644
@@ -138,27 +138,6 @@ static void yaml_propval(yaml_emitter_t *emitter, struct property *prop)
 		(yaml_char_t *)YAML_SEQ_TAG, 1, YAML_FLOW_SEQUENCE_STYLE);
 	yaml_emitter_emit_or_die(emitter, &event);
 
-	/* Ensure we have a type marker before any phandle */
-	for_each_marker(m) {
-		int last_offset = 0;
-		struct marker *type_m;
-
-		if (m->type >= TYPE_UINT8)
-			last_offset = m->offset;
-
-		if (!(m->next && m->next->type == REF_PHANDLE &&
-		      last_offset < m->next->offset))
-			continue;
-
-		type_m = xmalloc(sizeof(*type_m));
-		type_m->offset = m->next->offset;
-		type_m->type = TYPE_UINT32;
-		type_m->ref = NULL;
-		type_m->next = m->next;
-		m->next = type_m;
-	}
-
-	m = prop->val.markers;
 	for_each_marker(m) {
 		int chunk_len;
 		char *data = &prop->val.val[m->offset];
Signature · 1 line
2.20.1
Applied
#2 lore raw
In reply to a message not in the archive
Quoted 1 line · Rob Herring

This reverts commit 18d7b2f4ee45fec422b7d82bab0b3c762ee907e4.

Applied, it looks like that commit was based on some pretty faulty assumptions about how properties are structured.

Quoted 3 lines

This doesn't work for properties such as 'interrupt-map' that has phandle in the middle of an entry. It would also not work for a 0 or -1 phandle value that acts as a NULL.

I can't really make sense of that last sentence, though.

Quoted 38 lines
---
 yamltree.c | 21 ---------------------
 1 file changed, 21 deletions(-)
yamltree.c +0 -21
index 43ca869dd6a8..5b6ea8ea862f 100644
@@ -138,27 +138,6 @@ static void yaml_propval(yaml_emitter_t *emitter, struct property *prop)
 		(yaml_char_t *)YAML_SEQ_TAG, 1, YAML_FLOW_SEQUENCE_STYLE);
 	yaml_emitter_emit_or_die(emitter, &event);
 
-	/* Ensure we have a type marker before any phandle */
-	for_each_marker(m) {
-		int last_offset = 0;
-		struct marker *type_m;
-
-		if (m->type >= TYPE_UINT8)
-			last_offset = m->offset;
-
-		if (!(m->next && m->next->type == REF_PHANDLE &&
-		      last_offset < m->next->offset))
-			continue;
-
-		type_m = xmalloc(sizeof(*type_m));
-		type_m->offset = m->next->offset;
-		type_m->type = TYPE_UINT32;
-		type_m->ref = NULL;
-		type_m->next = m->next;
-		m->next = type_m;
-	}
-
-	m = prop->val.markers;
 	for_each_marker(m) {
 		int chunk_len;
 		char *data = &prop->val.val[m->offset];
Signature · 4 lines
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