From patchwork Tue Oct 17 23:36:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 10014029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 63ED860215 for ; Wed, 18 Oct 2017 08:17:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5312B28AE2 for ; Wed, 18 Oct 2017 08:17:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47B6428AF1; Wed, 18 Oct 2017 08:17:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F078028AE2 for ; Wed, 18 Oct 2017 08:17:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 85E6F6E7FD; Wed, 18 Oct 2017 08:17:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id C81F26E7B0 for ; Tue, 17 Oct 2017 23:36:47 +0000 (UTC) Received: by mail-pg0-x242.google.com with SMTP id y184so1495227pgd.12 for ; Tue, 17 Oct 2017 16:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Fbw2pbAUCnkZctZMJa9351gOuJ/ewJu1Ysp7ACh/O4U=; b=BWCfDzUoWxlmxPnAmkGV20fOqDYtNfTMX4/TFn0Kv5ZIzIzM6RO3P9l1aFEpQ+AlIz pLYbgIIMOrLlv0cHqQkqyqPJsJJxUVtRTcbmVdma+hhc4coOY41G91hzGT2mb5zwfmtE Nu/eOmuJHlSdxdP+/IW1BwglVjo4ATLNUjzZ964SuvPgKBSnFBT8qqfMjBKFb5LqLHxe aIrb5tJtVRCH7DZT1MAEkwXgKaRGkLKY/64wmJoIk+a3gn2zjZYwVSMkvU5U/Y0JJdic wWsWYZcb0bb2jLbBzrUCef/k/NJQaHUOXZHaReIJo9auavBgbU84AQHtxnuSst5S3TTd MVeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Fbw2pbAUCnkZctZMJa9351gOuJ/ewJu1Ysp7ACh/O4U=; b=C18RZFZzHbZ+edcDQqyskhuza8q/VA8LlQL40jNbkI6KtZp6drdeFxW4trF3nEHbWC pZOUaLR0ii0aAzRTosRZm2Jd+IASHXeKh02a12rY8oppN0MkN7kPT2mSVIPrkoNIxwAJ nhmnVwKDlaaiiOHSOMT/yj+PvVZW6Bb0kYSfrRmSl14Bv3a1CNZ0vy6XC9dFpGfUHYLx 4+8XzaoNNx9/rT3Aoj+A48l9IUXJAS3ygiCNO2iIbbrv7lLygMnXgCGQ2+farNJ6ZSpJ eQLoD4LI3B1bwNYn2YCTNJWVDh05HZxfxoZMfldNyEZ8/I+fXFS00nPRzRFzMGE1rDDM AqkA== X-Gm-Message-State: AMCzsaVG5e1Gob4ls1tBfHS/KKwc88E3/6g/7PMrv2mSOHuPLaIblveV D/+Oz5LT2ZpYfSplmwffyNQ= X-Google-Smtp-Source: AOwi7QCIz1N2nS7oz6O7lBop/EeTGWXDcA9LJT4a0dqLU4jhIccTI5l1n+Jvye8xsbmatERAt25Y9g== X-Received: by 10.84.232.138 with SMTP id i10mr13859338plk.104.1508283407514; Tue, 17 Oct 2017 16:36:47 -0700 (PDT) Received: from localhost.localdomain (c-73-93-215-6.hsd1.ca.comcast.net. [73.93.215.6]) by smtp.gmail.com with ESMTPSA id 76sm21185562pfq.4.2017.10.17.16.36.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Oct 2017 16:36:46 -0700 (PDT) From: frowand.list@gmail.com To: Rob Herring , Pantelis Antoniou , David Airlie , Jyri Sarha Subject: [PATCH v3 04/12] of: overlay: rename identifiers in dup_and_fixup_symbol_prop() Date: Tue, 17 Oct 2017 16:36:24 -0700 Message-Id: <1508283392-18252-5-git-send-email-frowand.list@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508283392-18252-1-git-send-email-frowand.list@gmail.com> References: <1508283392-18252-1-git-send-email-frowand.list@gmail.com> X-Mailman-Approved-At: Wed, 18 Oct 2017 08:17:09 +0000 Cc: Mark Rutland , devicetree@vger.kernel.org, Tomi Valkeinen , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Frank Rowand More renaming of identifiers to better reflect what they do. Signed-off-by: Frank Rowand --- 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 69610637af88..bb8867cae05b 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);