From patchwork Wed Aug 5 12:03:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1341212 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=OAlGzwvj; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BM9JQ1l2Zz9s1x for ; Wed, 5 Aug 2020 22:03:50 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 64CD481B5E; Wed, 5 Aug 2020 14:03:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="OAlGzwvj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 51F3681B5E; Wed, 5 Aug 2020 14:03:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) (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 CBFA181B5E for ; Wed, 5 Aug 2020 14:03:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x542.google.com with SMTP id c10so2600088edk.6 for ; Wed, 05 Aug 2020 05:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aDXUJMa4RrtA8bz0hnwoO6zlQjBca1zTGRToqOP4aTo=; b=OAlGzwvjcL9Y8lRvuFWFuVpezASIQca70elNhmTMvLaBo8KMB0uhxoMaVvR/3OR+Lm Pcqd/sG/DlYsYxMwrv9ClNrBCF+dO+kHLfxmLaAleoFGCnqSvD1kukh7lR/7BfZNXwJX 2beo1Rpm0UruRvK4f39jKEbYUC7ts3uJ1DYThi7kBc6KTgn1rH5WXK3W2qbUfRnKaksI RwCIoO6KiC4cHNK11lBE/Ytzg0ZoGcQDZBYFCtX3QEJy8m0I7fdxJBb1zb6j3yWNICPP gElx8ZYxEk2GR3XCaVociG/1DqpdTGmx97z7b4ASFIc1GgySjMl2XS6mZmk2ex6f5DRD TNcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=aDXUJMa4RrtA8bz0hnwoO6zlQjBca1zTGRToqOP4aTo=; b=AZr8YogbeHCUAhCyvxY6ZcYMPy/K3TSajKI2EOq2kwVqmHAqdz9T4fkwR+mAbM3l21 E9X/ecNna9FPI9XFwRfgqJNZJQB7TbY0opxHx2rMnMRch4ANki4YOdPXRWQVbHIrsHfB k5XplEAtkbeb1zhvWVLxcSFMa2DYn3G111xTndIgpOTBRH0iEjIo6sKpBmNmGmhT0N1h UCY0PzcPJ5MZMfJQcDGg0QnhXywNa4YtC8TNwiO+3QYDqLBZvzNi7LWquAcKDh28STgD QHiKPKjZGCDWUy8XySB577+zZeJZEjZ/v546Py8wAlCuUTsp06QQCT7H4+IvYUsJt4o3 3YPw== X-Gm-Message-State: AOAM530yck1UzCDN1aSuqjVMBkSYzA09JzznhXnOUwXawzUU6w0BsHoX OPMmsfJx2KEGJo3x70V3Mig2smrO9x6rgw== X-Google-Smtp-Source: ABdhPJzlidwk9fYmmQBNNSPZBgsqHbv/ntnJOX+fy3eTKp5dIKjAhFN/iSWguDuABrO+s+/RXJndwg== X-Received: by 2002:a50:a0a6:: with SMTP id 35mr2516349edo.37.1596629023198; Wed, 05 Aug 2020 05:03:43 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id l3sm1338646edv.3.2020.08.05.05.03.42 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Aug 2020 05:03:42 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ibai Erkiaga , Michal Simek , Simon Glass Subject: [PATCH] xilinx: Check return value from variable setup Date: Wed, 5 Aug 2020 14:03:41 +0200 Message-Id: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean env_set..() can failed that's why check return status and report it back to make sure that user is aware that's something went wrong. Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 0782d08ee3fe..0d6d0d29ac0f 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -78,15 +78,19 @@ void *board_fdt_blob_setup(void) int board_late_init_xilinx(void) { ulong initrd_hi; + int ret = 0; - env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); + ret |= env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE; initrd_hi = round_down(initrd_hi, SZ_16M); - env_set_addr("initrd_high", (void *)initrd_hi); + ret |= env_set_addr("initrd_high", (void *)initrd_hi); - env_set_addr("bootm_low", (void *)gd->ram_base); - env_set_addr("bootm_size", (void *)gd->ram_size); + ret |= env_set_addr("bootm_low", (void *)gd->ram_base); + ret |= env_set_addr("bootm_size", (void *)gd->ram_size); + + if (ret) + printf("%s: Saving run time variables FAILED\n", __func__); return 0; }