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=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 A3F50C6377B for ; Wed, 21 Jul 2021 20:55:58 +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 A25AA611C1 for ; Wed, 21 Jul 2021 20:55:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A25AA611C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9BF7882000; Wed, 21 Jul 2021 22:55:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="WS5R+fT4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 072D080A22; Wed, 21 Jul 2021 22:55:45 +0200 (CEST) Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) (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 1D17D80A22 for ; Wed, 21 Jul 2021 22:55:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oo1-xc2e.google.com with SMTP id e203-20020a4a55d40000b029025f4693434bso858586oob.3 for ; Wed, 21 Jul 2021 13:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k6ZgW470WHPLl7wUxg/jleon8qGsrMUAfVSSuMQRnH8=; b=WS5R+fT48WXoyMi3gAWad+cJYuSf6dhmpimDBcj4QsGud+T+yWzsPydjkNb5Sb0jNc K+kzWfecR84RFYg9BxT2McaJqI+R+dyqY1NuSW1Hmt8morHkM1SMCIWeMUYCyl+cRDV0 gKBWM/gIyffBa5CLqQU/kDZTzKiKo/5iZZ2Zc= 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:mime-version :content-transfer-encoding; bh=k6ZgW470WHPLl7wUxg/jleon8qGsrMUAfVSSuMQRnH8=; b=MWH6ONlAUPGbJaYoRg0ELa/nDVnYMA2yPHjGgjXbTwIpdC6VY/OadUfzVNtxyc60lm F/evv8/XMTLqa3nh4eH4CUcI49Q+jiirxHTyrD0ayzdwTKr9Z2pkunp9i8NrJRHFE2Ve ax7Mn6WQ3MN1z0IshtBEFPY8QYo2T/OAimKwmDJSH2YbiAq12SS6wIKxChl6SGzMUg7v HEjJ/KPNqjeB8p3mKI7ugAAH2dgRCYv+BebGOPk+k29BhFZQSFRCC5SEF4BPNc9bxVCV gk1tUXDKJ3BFzfWtvTE8ajAO4y2ZP0XU+Y4KMLDUMvuQ7b/U9WEcHT8ZVrBe/waJSWHO qy4w== X-Gm-Message-State: AOAM530HdPN/3zn5hgbw/ZLJoE4YwBOBOofCC+dTMvdZPKqMAjCAh0Iv lSON52es6rgMnh8J/SJRIOVkfm6GFShxnhdq X-Google-Smtp-Source: ABdhPJwxozQHrEEm4/Aa0PMP9a52ZvooIorlKwr4hLyrIXLdl9dZCB/wR/xFrI9TJKW7fj9zxl6jMQ== X-Received: by 2002:a4a:8687:: with SMTP id x7mr26085435ooh.46.1626900935940; Wed, 21 Jul 2021 13:55:35 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id m83sm1011330oig.25.2021.07.21.13.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 13:55:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jerry Van Baren Subject: [PATCH 1/2] fdt: Tidy up the code a bit with fdt addr Date: Wed, 21 Jul 2021 14:55:25 -0600 Message-Id: <20210721205526.1518565-1-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.402.g57bb445576-goog 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 Clean up the code a little before changing it. Signed-off-by: Simon Glass --- cmd/fdt.c | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/cmd/fdt.c b/cmd/fdt.c index f1e2fc2fd8b..5acc3ebaf33 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -115,26 +115,20 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (argc < 2) return CMD_RET_USAGE; - /* - * Set the address of the fdt - */ + /* fdt addr: Set the address of the fdt */ if (strncmp(argv[1], "ad", 2) == 0) { unsigned long addr; int control = 0; struct fdt_header *blob; - /* - * Set the address [and length] of the fdt. - */ + + /* Set the address [and length] of the fdt */ argc -= 2; argv += 2; -/* Temporary #ifdef - some archs don't have fdt_blob yet */ -#ifdef CONFIG_OF_CONTROL if (argc && !strcmp(*argv, "-c")) { control = 1; argc--; argv++; } -#endif if (argc == 0) { if (control) blob = (struct fdt_header *)gd->fdt_blob; @@ -160,22 +154,18 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (argc >= 2) { int len; int err; - /* - * Optional new length - */ + + /* Optional new length */ len = simple_strtoul(argv[1], NULL, 16); if (len < fdt_totalsize(blob)) { - printf ("New length %d < existing length %d, " - "ignoring.\n", - len, fdt_totalsize(blob)); + printf("New length %d < existing length %d, ignoring\n", + len, fdt_totalsize(blob)); } else { - /* - * Open in place with a new length. - */ + /* Open in place with a new length */ err = fdt_open_into(blob, blob, len); if (err != 0) { - printf ("libfdt fdt_open_into(): %s\n", - fdt_strerror(err)); + printf("libfdt fdt_open_into(): %s\n", + fdt_strerror(err)); } } } @@ -184,10 +174,9 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (!working_fdt) { - puts( - "No FDT memory address configured. Please configure\n" - "the FDT address via \"fdt addr
\" command.\n" - "Aborting!\n"); + puts("No FDT memory address configured. Please configure\n" + "the FDT address via \"fdt addr
\" command.\n" + "Aborting!\n"); return CMD_RET_FAILURE; } -- 2.32.0.402.g57bb445576-goog