From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3CC9C433EF for ; Fri, 3 Sep 2021 13:17:21 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AAC560FC0 for ; Fri, 3 Sep 2021 13:17:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4AAC560FC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 02D6D83551; Fri, 3 Sep 2021 15:16:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ll3llG7e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 222C683562; Fri, 3 Sep 2021 15:16:52 +0200 (CEST) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 451A483562 for ; Fri, 3 Sep 2021 15:16:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=thierry.reding@gmail.com Received: by mail-wr1-x433.google.com with SMTP id n5so8183461wro.12 for ; Fri, 03 Sep 2021 06:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uRGnTVytfdVwGnShO4yA/RS92hensEkIfuvmblJKbhg=; b=Ll3llG7eFEljodtzoInaI8yUdCFLQEfEbPPjff9HOsxRPxSfWfLUtB+NQE+hG56I5j 8zBeLaYGQVbL5JlBEo3TcRfdjMVJm35kee9GTVhpp0i6JgsDOEYhjwhovnAJq7u1nEbC q7WR+GqxjJgKpzxD7ypl+wA52Dy076yWioA/5af0qAvux5Dd45Fwuwc6k1luIDb3JlMn I03lGKddrV7OQ1H9RQgUBr8RWpSiJGUL9+QKC9nonxquHlpiCh8iASjdoeHoVZimGwyu 1V33ApiVFPg/SoRnTSM+Ssy5nebxZTfk96pik9vN6doJo7llucD2rFF7i+AfiFhazjB+ bFIw== 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:mime-version:content-transfer-encoding; bh=uRGnTVytfdVwGnShO4yA/RS92hensEkIfuvmblJKbhg=; b=HIGQSDS/FxI9qdrjgDGc8SHbgopvYAcWoAYMngU1s2wV63IxJVy+LHVvWhdRFY0JrE vF/kHo7wQJlIeHnZ3IapdDa8k6KIoTErgsCjz3gMSsTcpTP6d+qjVEK0AEsP+6oFjnn+ +n48fWWSQW8hj16qFRlm+PDFlrWZl4djTM0LvypE2mcJfkgBgqo0CksJSiGxE93JvROZ 6YIk6iVisLoJv52pyTXZaBPR9dKlO0YxtLdHswNwU+ftdATHOyxuwJwxLYbOoMZ8Bwfu 4fmIcXi/nldwjhrmt3RKDuBByLjVKH9Sa+vKVa0eHIUy9lAQjur43hlUPSI31mxHb//0 q6Tw== X-Gm-Message-State: AOAM5329rj//reS+hY8FZIa+e1tk6n5Ow1BOTFTcF6mOvy3UUioHhrLy XHNqJ6npv0MsjGZH514kr7g= X-Google-Smtp-Source: ABdhPJw3w06gWOg/eHVUJ55Aa+Pp+Mq3ORAXTQC3BvmrkL9KryGCsmYAACQEGDbcnhYUEF6utRKnlA== X-Received: by 2002:adf:8102:: with SMTP id 2mr4018744wrm.89.1630675001742; Fri, 03 Sep 2021 06:16:41 -0700 (PDT) Received: from localhost ([217.111.27.204]) by smtp.gmail.com with ESMTPSA id q10sm4244711wmq.12.2021.09.03.06.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 06:16:40 -0700 (PDT) From: Thierry Reding To: Tom Warren Cc: Simon Glass , u-boot@lists.denx.de Subject: [PATCH 4/9] fdtdec: Reorder fdtdec_set_carveout() parameters for consistency Date: Fri, 3 Sep 2021 15:16:20 +0200 Message-Id: <20210903131625.2153838-5-thierry.reding@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210903131625.2153838-1-thierry.reding@gmail.com> References: <20210903131625.2153838-1-thierry.reding@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Thierry Reding The fdtdec_set_carveout() function's parameters are inconsistent with the parameters passed to fdtdec_add_reserved_memory(). Fix up the order to make it more consistent. Signed-off-by: Thierry Reding --- board/nvidia/p2371-2180/p2371-2180.c | 4 ++-- board/nvidia/p2771-0000/p2771-0000.c | 4 ++-- board/nvidia/p3450-0000/p3450-0000.c | 4 ++-- include/fdtdec.h | 8 ++++---- lib/fdtdec.c | 6 +++--- lib/fdtdec_test.c | 4 ++-- test/dm/fdtdec.c | 15 ++++++--------- 7 files changed, 21 insertions(+), 24 deletions(-) diff --git a/board/nvidia/p2371-2180/p2371-2180.c b/board/nvidia/p2371-2180/p2371-2180.c index 58077255d073..bc0a133725ed 100644 --- a/board/nvidia/p2371-2180/p2371-2180.c +++ b/board/nvidia/p2371-2180/p2371-2180.c @@ -138,8 +138,8 @@ static int ft_copy_carveout(void *dst, const void *src, const char *node) return err; } - err = fdtdec_set_carveout(dst, node, "memory-region", 0, "framebuffer", - NULL, 0, &fb); + err = fdtdec_set_carveout(dst, node, "memory-region", 0, &fb, + "framebuffer", NULL, 0); if (err < 0) { printf("failed to set carveout for %s: %d\n", node, err); return err; diff --git a/board/nvidia/p2771-0000/p2771-0000.c b/board/nvidia/p2771-0000/p2771-0000.c index e35e6b6f48dc..cde5eff02f2a 100644 --- a/board/nvidia/p2771-0000/p2771-0000.c +++ b/board/nvidia/p2771-0000/p2771-0000.c @@ -114,8 +114,8 @@ static int ft_copy_carveout(void *dst, const void *src, const char *node) return err; } - err = fdtdec_set_carveout(dst, node, "memory-region", 0, "framebuffer", - NULL, 0, &fb); + err = fdtdec_set_carveout(dst, node, "memory-region", 0, &fb, + "framebuffer", NULL, 0); if (err < 0) { printf("failed to set carveout for %s: %d\n", node, err); return err; diff --git a/board/nvidia/p3450-0000/p3450-0000.c b/board/nvidia/p3450-0000/p3450-0000.c index d9ef45af5eea..541863cef361 100644 --- a/board/nvidia/p3450-0000/p3450-0000.c +++ b/board/nvidia/p3450-0000/p3450-0000.c @@ -138,8 +138,8 @@ static int ft_copy_carveout(void *dst, const void *src, const char *node) return err; } - err = fdtdec_set_carveout(dst, node, "memory-region", 0, "framebuffer", - NULL, 0, &fb); + err = fdtdec_set_carveout(dst, node, "memory-region", 0, &fb, + "framebuffer", NULL, 0); if (err < 0) { printf("failed to set carveout for %s: %d\n", node, err); return err; diff --git a/include/fdtdec.h b/include/fdtdec.h index 489f5063763b..6d56c67d111c 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -1143,16 +1143,16 @@ int fdtdec_get_carveout(const void *blob, const char *node, * @param prop_name name of the property in which to store the phandle of * the carveout * @param index index of the phandle to store - * @param name base name of the reserved-memory node to create * @param carveout information about the carveout to add + * @param name base name of the reserved-memory node to create * @param compatibles compatible strings to set for the carveout * @param count number of compatible strings * @return 0 on success or a negative error code on failure */ int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name, - unsigned int index, const char *name, - const char **compatibles, unsigned int count, - const struct fdt_memory *carveout); + unsigned int index, const struct fdt_memory *carveout, + const char *name, const char **compatibles, + unsigned int count); /** * Set up the device tree ready for use diff --git a/lib/fdtdec.c b/lib/fdtdec.c index ba1fefaeef9d..60e537b8d61e 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1561,9 +1561,9 @@ skip_compat: } int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name, - unsigned int index, const char *name, - const char **compatibles, unsigned int count, - const struct fdt_memory *carveout) + unsigned int index, const struct fdt_memory *carveout, + const char *name, const char **compatibles, + unsigned int count) { uint32_t phandle; int err, offset, len; diff --git a/lib/fdtdec_test.c b/lib/fdtdec_test.c index 72c3001a2105..3af9fb5da604 100644 --- a/lib/fdtdec_test.c +++ b/lib/fdtdec_test.c @@ -189,8 +189,8 @@ static int make_fdt_carveout_device(void *fdt, uint32_t na, uint32_t ns) offset = CHECK(fdt_add_subnode(fdt, 0, name + 1)); CHECK(fdt_setprop(fdt, offset, "reg", cells, (na + ns) * sizeof(*cells))); - return fdtdec_set_carveout(fdt, name, "memory-region", 0, - "framebuffer", NULL, 0, &carveout); + return fdtdec_set_carveout(fdt, name, "memory-region", 0, &carveout, + "framebuffer", NULL, 0); } static int check_fdt_carveout(void *fdt, uint32_t address_cells, diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c index 7b543e7b998e..385aa77a686f 100644 --- a/test/dm/fdtdec.c +++ b/test/dm/fdtdec.c @@ -28,21 +28,18 @@ static int dm_test_fdtdec_set_carveout(struct unit_test_state *uts) resv.start = 0x1000; resv.end = 0x2000; - ut_assertok(fdtdec_set_carveout(blob, "/a-test", - "memory-region", 2, "test_resv1", - NULL, 0, &resv)); + ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 2, + &resv, "test_resv1", NULL, 0)); resv.start = 0x10000; resv.end = 0x20000; - ut_assertok(fdtdec_set_carveout(blob, "/a-test", - "memory-region", 1, "test_resv2", - NULL, 0, &resv)); + ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 1, + &resv, "test_resv2", NULL, 0)); resv.start = 0x100000; resv.end = 0x200000; - ut_assertok(fdtdec_set_carveout(blob, "/a-test", - "memory-region", 0, "test_resv3", - NULL, 0, &resv)); + ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 0, + &resv, "test_resv3", NULL, 0)); offset = fdt_path_offset(blob, "/a-test"); ut_assert(offset > 0); -- 2.33.0