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 4BC76C001DB for ; Tue, 8 Aug 2023 10:22:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 96DE68522C; Tue, 8 Aug 2023 12:22:37 +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="Mv+MsGCS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4DD9D854BD; Tue, 8 Aug 2023 12:22:37 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (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 D8662847D9 for ; Tue, 8 Aug 2023 12:22:34 +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 0471566071F7; Tue, 8 Aug 2023 11:22:33 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1691490154; bh=l3gdP23EBooRsnyBYYp9kJn1RoXOMBj1kXg9gz+/dSU=; h=From:To:Cc:Subject:Date:From; b=Mv+MsGCSrko9zA8lEbaDjQA9WsT+rugzBqyi83KwFybjB5sFzTNKxagtNL7Mh5CqQ dwxmtdPc3+eIcn4LL7o/In6pj2qITZEVOQA5W083gmTzmQ0gD2iQG8I8/S0/SZZe42 +/BMoZuvxiiyPItvIdOnDu1CPuhg7zXY9zTCP16lnel27nBp5VpcalbX8b1mglj8QL Y+1FWuWlA4HOy3ATuclIpIFJIeVH6HIAnYE1NiWc2lNh0sDOYYlQk2ZWB5Eg7oBYzh uQLGTipHY/R5q/Mt8CwMiEBhalNGulXps4mnxmBYqDx2pzz1IvCyz9zutIC4PxmvEY Pead5OCNtF5Rw== From: Eugen Hristev To: u-boot@lists.denx.de, michal.simek@amd.com, sjg@chromium.org Cc: Eugen Hristev Subject: [PATCH RESEND v3] fpga: add inline stub for fpga_load Date: Tue, 8 Aug 2023 13:22:27 +0300 Message-Id: <20230808102227.34233-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