Re: [PATCH v2 05/10] fdtdump: Handle unknown tags

Frank Li <[email protected]> Thu, 4 Jun 2026 17:19:42 -0400
Newsgroups org.kernel.vger.devicetree-compiler,org.kernel.vger.devicetree-spec,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <aiHr7l0CsJjRem1S@lizhi-Precision-Tower-5810>
On Thu, Apr 09, 2026 at 01:54:21PM +0200, Herve Codina wrote:
> The structured tag value definition introduced recently gives the
> ability to ignore unknown tags without any error when they are read.
>
> Add support for those structured tags in fdtdump and introduce a command
> line option to dump unknown tags that should be ignored.
>
> Signed-off-by: Herve Codina <[email protected]>
> ---
>  fdtdump.c                              |  45 +++++++++-
>  tests/dumptrees.c                      |   4 +-
>  tests/run_tests.sh                     |  41 +++++++++
>  tests/testdata.h                       |   2 +
>  tests/trees.S                          | 116 +++++++++++++++++++++++++
>  tests/unknown_tags_can_skip.dtb.expect |  29 +++++++
>  6 files changed, 233 insertions(+), 4 deletions(-)
>  create mode 100644 tests/unknown_tags_can_skip.dtb.expect
>
...
>  };
>  static const char * const usage_opts_help[] = {
>  	"Dump debug information while decoding the file",
> +	"Dump unknown tags information while decoding the file (-uu to dump data)",
>  	"Scan for an embedded fdt in file",
>  	USAGE_COMMON_OPTS_HELP
>  };
> @@ -183,6 +218,7 @@ int main(int argc, char *argv[])
>  	const char *file;
>  	char *buf;
>  	bool debug = false;
> +	int dump_unknown = 0;
>  	bool scan = false;
>  	size_t len;
>
> @@ -198,6 +234,9 @@ int main(int argc, char *argv[])
>  		case 'd':
>  			debug = true;
>  			break;
> +		case 'u':
> +			dump_unknown++;

does dump_unknown should bool?

Frank