Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BDF7DEB64DC for ; Mon, 17 Jul 2023 13:25:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F03D386663; Mon, 17 Jul 2023 15:25:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.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=collabora.com header.i=@collabora.com header.b="NCTXIVA8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 690C186667; Mon, 17 Jul 2023 15:25:16 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 10FE48634C for ; Mon, 17 Jul 2023 15:25:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from eugen-station.. (unknown [82.76.24.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id 2BF776606FC8; Mon, 17 Jul 2023 14:25:13 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689600313; bh=l3gdP23EBooRsnyBYYp9kJn1RoXOMBj1kXg9gz+/dSU=; h=From:To:Cc:Subject:Date:From; b=NCTXIVA8mzbl+ZosEuJkKr4tyDTta7yzWaoEzjH+dVb2g1+SvbkzvGIftmoyMnZxP QkT5jZ24+BOWK+VcpefvopvG/nuQZqZchZkuAuweEYpKC/KWTtttQ3qPKxpD1gMGtr j4FBCnnPGBr1XSvYET609JihLyUTqEnR/VohtenUX4GMFkJ5whS4pCj0KgD/EGrb6y huXTyjbeciBgmJspREilfJSZMqzm4qr0RbUAayGYEn9cAGD90YfPtoL3QXKxZ+1HS4 FGlMc4r1mMuojAWiUUOvbxlOM20iSP/GSJl1KPtdp0Z6UWe/9Bs0RdkHKGAfMt1hxh 1h3buRYMO/jsA== From: Eugen Hristev To: u-boot@lists.denx.de, Simon Glass Cc: kernel@collabora.com, Eugen Hristev Subject: [PATCH v3] fpga: add inline stub for fpga_load Date: Mon, 17 Jul 2023 16:25:08 +0300 Message-Id: <20230717132508.251268-1-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean In case CC_OPTIMIZE_FOR_DEBUG is set, unused code will not be optimized out, hence the reference to fpga_load will be compiled. if DM_FPGA and SPL_FPGA are not set, the build will fail with : aarch64-none-linux-gnu-ld.bfd: common/spl/spl_fit.o: in function `spl_fit_upload_fpga': u-boot/common/spl/spl_fit.c:595: undefined reference to `fpga_load' To solve this, added an inline empty stub in the header if CC_OPTIMIZE_FOR_DEBUG is set such that the build will succeed. Signed-off-by: Eugen Hristev --- Changes in v3: - return -ENOSYS Changes in v2: - this is a rework as suggested by Simon of this previous patch : https://patchwork.ozlabs.org/project/uboot/patch/20230619102839.277902-1-eugen.hristev@collabora.com/ include/fpga.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/fpga.h b/include/fpga.h index ed688cc0fa3b..33d0dbbe2ba4 100644 --- a/include/fpga.h +++ b/include/fpga.h @@ -60,8 +60,17 @@ int fpga_add(fpga_type devtype, void *desc); int fpga_count(void); const fpga_desc *const fpga_get_desc(int devnum); int fpga_is_partial_data(int devnum, size_t img_len); +#if defined(CONFIG_CC_OPTIMIZE_FOR_DEBUG) +static inline int fpga_load(int devnum, const void *buf, size_t bsize, + bitstream_type bstype, int flags) +{ + return -ENOSYS; +} +#else int fpga_load(int devnum, const void *buf, size_t bsize, bitstream_type bstype, int flags); +#endif + int fpga_fsload(int devnum, const void *buf, size_t size, fpga_fs_info *fpga_fsinfo); int fpga_loads(int devnum, const void *buf, size_t size, -- 2.34.1