From: frowand.list@gmail.com
To: Rob Herring <robh+dt@kernel.org>,
Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
David Airlie <airlied@linux.ie>, Jyri Sarha <jsarha@ti.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Mark Rutland <mark.rutland@arm.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
dri-devel@lists.freedesktop.org
Subject: [PATCH v2 04/12] of: overlay: rename identifiers in dup_and_fixup_symbol_prop()
Date: Mon, 16 Oct 2017 18:17:46 -0700 [thread overview]
Message-ID: <1508203074-26917-5-git-send-email-frowand.list@gmail.com> (raw)
In-Reply-To: <1508203074-26917-1-git-send-email-frowand.list@gmail.com>
From: Frank Rowand <frank.rowand@sony.com>
More renaming of identifiers to better reflect what they do.
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
---
drivers/of/overlay.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 397ef10d1f26..c350742ed2a2 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -90,17 +90,29 @@ static int overlay_notify(struct overlay_changeset *ovcs,
return 0;
}
+/*
+ * The properties in the "/__symbols__" node are "symbols".
+ *
+ * The value of properties in the "/__symbols__" node is the path of a
+ * node in the subtree of a fragment node's "__overlay__" node, for
+ * example "/fragment@0/__overlay__/symbol_path_tail". Symbol_path_tail
+ * can be a single node or it may be a multi-node path.
+ *
+ * The duplicated property value will be modified by replacing the
+ * "/fragment_name/__overlay/" portion of the value with the target
+ * path from the fragment node.
+ */
static struct property *dup_and_fixup_symbol_prop(
struct overlay_changeset *ovcs, const struct property *prop)
{
struct fragment *fragment;
struct property *new;
const char *overlay_name;
- char *label_path;
+ char *symbol_path_tail;
char *symbol_path;
const char *target_path;
int k;
- int label_path_len;
+ int symbol_path_tail_len;
int overlay_name_len;
int target_path_len;
@@ -126,18 +138,18 @@ static struct property *dup_and_fixup_symbol_prop(
target_path = fragment->target->full_name;
target_path_len = strlen(target_path);
- label_path = symbol_path + overlay_name_len;
- label_path_len = strlen(label_path);
+ symbol_path_tail = symbol_path + overlay_name_len;
+ symbol_path_tail_len = strlen(symbol_path_tail);
new->name = kstrdup(prop->name, GFP_KERNEL);
- new->length = target_path_len + label_path_len + 1;
+ new->length = target_path_len + symbol_path_tail_len + 1;
new->value = kzalloc(new->length, GFP_KERNEL);
if (!new->name || !new->value)
goto err_free;
strcpy(new->value, target_path);
- strcpy(new->value + target_path_len, label_path);
+ strcpy(new->value + target_path_len, symbol_path_tail);
of_property_set_flag(new, OF_DYNAMIC);
--
Frank Rowand <frank.rowand@sony.com>
next prev parent reply other threads:[~2017-10-17 1:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 1:17 [PATCH v2 00/12] of: overlay: clean up device tree overlay code frowand.list-Re5JQEeQqe8AvxtiuMwx3w
2017-10-17 1:17 ` [PATCH v2 01/12] of: overlay.c: Remove comments that state the obvious, to reduce clutter frowand.list
2017-10-17 1:17 ` [PATCH v2 02/12] of: overlay.c: Convert comparisons to zero or NULL to logical expressions frowand.list
2017-10-17 1:17 ` [PATCH v2 03/12] of: overlay: rename identifiers to more reflect what they do frowand.list
2017-10-17 14:38 ` Rob Herring
[not found] ` <CAL_JsqJDZFznVm0TvCePHq_J-FhNyEXoLEue_ZRhOm6LyXC5kQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-17 18:53 ` Frank Rowand
2017-10-17 1:17 ` frowand.list [this message]
2017-10-17 1:17 ` [PATCH v2 05/12] of: overlay: minor restructuring frowand.list
2017-10-17 1:17 ` [PATCH v2 06/12] of: overlay: detect cases where device tree may become corrupt frowand.list
2017-10-17 1:17 ` [PATCH v2 07/12] of: overlay: expand check of whether overlay changeset can be removed frowand.list
2017-10-17 1:17 ` [PATCH v2 08/12] of: overlay: loosen overly strict phandle clash check frowand.list
2017-10-17 1:17 ` [PATCH v2 09/12] of: overlay: avoid race condition between applying multiple overlays frowand.list
2017-10-17 2:04 ` Frank Rowand
2017-10-17 1:17 ` [PATCH v2 10/12] of: overlay: simplify applying symbols from an overlay frowand.list
[not found] ` <1508203074-26917-1-git-send-email-frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-17 1:17 ` [PATCH v2 11/12] of: overlay: remove a dependency on device node full_name frowand.list-Re5JQEeQqe8AvxtiuMwx3w
2017-10-17 1:17 ` [PATCH v2 12/12] of: overlay: remove unneeded check for NULL kbasename() frowand.list
2017-10-17 2:04 ` [PATCH v2 00/12] of: overlay: clean up device tree overlay code Frank Rowand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508203074-26917-5-git-send-email-frowand.list@gmail.com \
--to=frowand.list@gmail.com \
--cc=airlied@linux.ie \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsarha@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pantelis.antoniou@konsulko.com \
--cc=robh+dt@kernel.org \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).