From patchwork Sat Sep 11 14:31:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1526744 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=KtNbWW/l; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4H6FYb2QHlz9sVw for ; Sun, 12 Sep 2021 00:31:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 54E1D83806; Sat, 11 Sep 2021 16:31:40 +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="KtNbWW/l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFFBB83807; Sat, 11 Sep 2021 16:31:37 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 EABC2837A0 for ; Sat, 11 Sep 2021 16:31:33 +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=bmeng.cn@gmail.com Received: by mail-pj1-x102e.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so3501903pjc.3 for ; Sat, 11 Sep 2021 07:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=FErRRkIDr9JIIUUNmyqxtfWpPzVbxnMKYhdx4gqKzv4=; b=KtNbWW/lXOnESqgEEgeqToc4ozEERRlriVq6E2pFhXPA9axPN3J0etEyTaEKOFRqD1 yUt2p33XLwl2aw2WbWjIg3BzvJYiyQXRhA8z4sqZEEu8ICkHL1aITN5Xsyn+ydQwuCMu DnJX2BAJNu2W2pZpNtq7virX9ZceVwFaywyv70MkNjLf1P7Uc8+3/PgsEOIK/XNlgSLo MoBZut9nAkyt9Z2kNvR2jJcK8zWWbhFcEDFFwLxq2uuSiakTDC+vELaWr+1GM13LLult ZbmjDnypas28IVmwfQ3E9mc9wxQWrP+xZoZtyTg02+haQEq/tAy6loBYWi9DQlMSTPFh A9Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=FErRRkIDr9JIIUUNmyqxtfWpPzVbxnMKYhdx4gqKzv4=; b=uZl2GGVfWosO1/DiPBnDbdHDda/OGlXSDx7nPhOgzzyu7aufmFkeTXZjNPXX/+bFNf EAdNiO4YtCckxPEDJsmIsIXD/s44J8FQMl2esgLdEKzkR/j7RDrPOtHnaJBEOiOQ00r6 KBzr/0b2pNjc6jV1uEqnDtH78oXboxNdw2sIiFZj6t6bgad0Npklr1BC6i7tMCReTC0A jQluRy8fiIZXojDsgFIE8anj8nxpjoyS2vX4EcW5mvPgT5RkTDj4vEyTQu8K4M7UZ+6a xyqjWSv/mYEFJJRSrfpR/Gl+VDX91y8ogdVbjTA58AWNsMGZHRwpSJWtLf9PTuApoJpP R9nA== X-Gm-Message-State: AOAM533Pb+7Xr2CNTiNFc1Z77VAQQ78Qwgkl8D2rWGLfO/tfFFpzu9wh U/TCDFxhv24Njr8dpUAX+I8wSIUIkWw= X-Google-Smtp-Source: ABdhPJw3XyTuePGtupPsTxYCfN/I0TwGqiZsb6Bita4K11EWBisy4Ge4c1Gb5UWUtSpyZ9R4TC5mVA== X-Received: by 2002:a17:90b:4a8a:: with SMTP id lp10mr3219209pjb.216.1631370692225; Sat, 11 Sep 2021 07:31:32 -0700 (PDT) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id e2sm1917704pjm.2.2021.09.11.07.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 07:31:31 -0700 (PDT) From: Bin Meng To: Zong Li , Leo Yu-Chi Liang , Rick Chen , u-boot@lists.denx.de Subject: [PATCH v2] board: sifive: Fix a potential build warning in board_fdt_blob_setup() Date: Sat, 11 Sep 2021 22:31:23 +0800 Message-Id: <20210911143123.10423-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 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.103.2 at phobos.denx.de X-Virus-Status: Clean Commit 47d73ba4f4a4 ("board: sifive: overwrite board_fdt_blob_setup in u-boot proper") added a board-specific implementation of board_fdt_blob_setup() which takes a pointer as the return value, but it does not return anything if CONFIG_OF_SEPARATE is not enabled. This will cause a build warning seen when testing booting S-mode U-Boot directly from QEMU, per the instructions in [1]: board/sifive/unleashed/unleashed.c: In function ‘board_fdt_blob_setup’: board/sifive/unleashed/unleashed.c:125:1: warning: control reaches end of non-void function [-Wreturn-type] Return &_end as the default case. [1] https://qemu.readthedocs.io/en/latest/system/riscv/sifive_u.html#running-u-boot Signed-off-by: Bin Meng Reviewed-by: Leo Yu-Chi Liang Reviewed-by: Rick Chen --- Changes in v2: - Correct the commit title board/sifive/unleashed/unleashed.c | 4 ++-- board/sifive/unmatched/unmatched.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c index 8cd514df30..33baeda986 100644 --- a/board/sifive/unleashed/unleashed.c +++ b/board/sifive/unleashed/unleashed.c @@ -119,9 +119,9 @@ void *board_fdt_blob_setup(void) if (IS_ENABLED(CONFIG_OF_SEPARATE)) { if (gd->arch.firmware_fdt_addr) return (ulong *)gd->arch.firmware_fdt_addr; - else - return (ulong *)&_end; } + + return (ulong *)&_end; } int board_init(void) diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c index d90b252bae..8773b660fa 100644 --- a/board/sifive/unmatched/unmatched.c +++ b/board/sifive/unmatched/unmatched.c @@ -16,9 +16,9 @@ void *board_fdt_blob_setup(void) if (IS_ENABLED(CONFIG_OF_SEPARATE)) { if (gd->arch.firmware_fdt_addr) return (ulong *)gd->arch.firmware_fdt_addr; - else - return (ulong *)&_end; } + + return (ulong *)&_end; } int board_init(void)