Thread (1 message) 1 message, 1 author, 2016-07-12

Re: [PATCH v2 6/6] libfdt: Add overlay application function

From: David Gibson <hidden>
Date: 2016-07-12 14:34:04

On Mon, Jul 11, 2016 at 09:20:44PM +0100, Phil Elwell wrote:
On 11/07/2016 20:56, Maxime Ripard wrote:
[snip]
quoted
+static int overlay_merge(void *fdt, void *fdto)
+{
+	int fragment;
+
+	fdt_for_each_subnode(fragment, fdto, 0) {
+		int overlay;
+		int target;
+		int ret;
+
+		target = overlay_get_target(fdt, fdto, fragment);
+		if (target < 0)
+			continue;
+
+		overlay = fdt_subnode_offset(fdto, fragment, "__overlay__");
+		if (overlay < 0)
+			return overlay;
Why does the absence of a target cause a fragment to be ignored but
the absence of an "__overlay__" property cause the merging to be
abandoned with an error? Can't we just ignore fragments that aren't
recognised?
So, I had the same question.  But fragments we can't make sense MUST
cause failures, and not be silently ignored.

An incompletely applied overlay is almost certainly going to cause you
horrible grief at some point, so you absolutely want to know early if
your overlay is in a format your tool doesn't understand.

-- 
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

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