Thread (58 messages) flat view 58 messages, 2 authors, 1d ago

Re: [PATCH v3 06/15] Introduce structured tag value definition

From: David Gibson <hidden>
Date: 2026-09-10 09:42:00
Also in: lkml

On Thu, Sep 10, 2026 at 09:58:23AM +0200, Herve Codina wrote:
Hi david,

On Thu, 10 Sep 2026 15:33:58 +1000
David Gibson [off-list ref] wrote:
quoted
On Wed, Aug 26, 2026 at 10:31:37AM +0200, Herve Codina wrote:
[snip]
quoted
+#define FDT_TAG_CAN_SKIP(tag_data, tag_id) \
+		(FDT_TAG_STRUCTURED | FDT_TAG_SKIP_SAFE | tag_data | tag_id)
+
+/* Tests reserved tags */
+#define FDT_TEST_NONE_CAN_SKIP		FDT_TAG_CAN_SKIP(FDT_TAG_DATA_NONE, 0)
+#define FDT_TEST_1CELL_CAN_SKIP		FDT_TAG_CAN_SKIP(FDT_TAG_DATA_1CELL, 0)
+#define FDT_TEST_2CELLS_CAN_SKIP	FDT_TAG_CAN_SKIP(FDT_TAG_DATA_2CELLS, 0)
+#define FDT_TEST_VARLEN_CAN_SKIP	FDT_TAG_CAN_SKIP(FDT_TAG_DATA_VARLEN, 0)
+#define FDT_TEST_NONE_NO_SKIP		FDT_TAG_NO_SKIP(FDT_TAG_DATA_NONE, 0)  
Sorry, missed until I saw the later treegen changes that this is
defining some specific tag values.

Given that, "Tests reserved tags" needs to be expanded to better
explain what these tags are for - what should readers do upon
encountering them, when should writers use it ("never, unless you're a
test case" is acceptable).
I would say, in both cases, consider them as "unknown" tags.
And so:
/*
 * Tests reserved tags
 * 
 * When those tags are encountered they should be considered as "unknown"
 * tags and rules related to "unknown" tags must be followed.
 *
 * Readers should skip them or fail depending on the SKIP_SAFE flag. Writers
 * should never use those tags. Their usage is only acceptable in test cases.
 */
quoted
It might be worth reserving a whole range of tag values for tests /
documentation / experimentation, rather than just a handful of
specific values.
Ok. The range reservation will added be in the comment.

/*
 * Tests reserved tags
 *
 * A TAG_ID range in "structured tags" is reserved to tests tags.
 * This tests reserved range is from tag_id 0 to tag_id 0x100.
 *
 * When those tags are encountered they should be considered as "unknown"
 * tags and rules related to "unknown" tags must be followed.
 *
 * Readers should skip them or fail depending on the SKIP_SAFE flag. Writers
 * should never use those tags. Their usage is only acceptable in test cases.
 */

Is it ok?
I'd probably put the reserved range up high somewhere rather than
starting at 0.  Otherwise it looks good.


-- 
David Gibson (he or they)	| 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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help