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 12BDCEB64DA for ; Wed, 5 Jul 2023 13:05:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5ABC0863B2; Wed, 5 Jul 2023 15:05:11 +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="SUoylv4O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 00B62863B8; Wed, 5 Jul 2023 15:05:09 +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 663BB86333 for ; Wed, 5 Jul 2023 15:05:07 +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 8E6A066020F5; Wed, 5 Jul 2023 14:05:05 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688562306; bh=+jhNOLWUR8J/Gb8Xb0H01FiKryKlvqK7n69pMhK2op0=; h=From:To:Cc:Subject:Date:From; b=SUoylv4OeqzOfJxU+d0bMVq7ptIzkSUjMaNRK99r1xaIGsnSw0ZBem7fLkaW6KW+f kgciQPaKm4B93AEnGZ/+NYGLCq5Kz2aJ0DgGaPaI8/u1yeP0RV5qO3wSeqJjnklESn Q0p6weDAkSq3dlfT/hbxFdojxVutCvTULM8wWiFMYYi5GqWQNqVx/oOFVILWU8tUwM cYvKSZJAN4aad0Lv/VqrJaeCQJxZzZp5599GCXXuZtEfWfd9XKgjG/ysXfYTnmsfF9 55/PAYasrV8nZXXzPSUgw1AgmN1C7dVA4b0L2oC1k6zt4nYimh4DwBO/QnETCzVySq 2K5O7lN9sTRNQ== From: Eugen Hristev To: Simon Glass , u-boot@lists.denx.de Cc: kernel@collabora.com, Eugen Hristev Subject: [PATCH v2] fpga: add inline stub for fpga_load Date: Wed, 5 Jul 2023 16:04:58 +0300 Message-Id: <20230705130458.88973-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 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..50ab03af06bb 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 0; +} +#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