From patchwork Thu Nov 19 00:37:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1402666 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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Tq7VDw8A; dkim-atps=neutral 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cc14X5NxRz9sTc for ; Thu, 19 Nov 2020 11:38:07 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB89E82309; Thu, 19 Nov 2020 01:37:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="Tq7VDw8A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 78C7C822C7; Thu, 19 Nov 2020 01:37:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (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 78622822C7 for ; Thu, 19 Nov 2020 01:37:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x541.google.com with SMTP id w4so2579610pgg.13 for ; Wed, 18 Nov 2020 16:37:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JMqLyxGJaMPYorTnqgPPQ67/zhXXKBCrl5Mw2WUKHrg=; b=Tq7VDw8A0+c3BYPU7B5Ts8j6W90yCZoeiXYzh4s9R+e7AcogSS9ol56IYnTp8IVWat XWPeuM73XIKQUZ13W02qlTlOw9OuoFjDCnT2dWxyGoXAZcOvSuLooUGRMwNJ0xGH0XRk 3B2NS4MNLUxUuXQ6CDf+SBtPxbrke5XZVBXKtiPKP1WHmD9pR/SlOrXUkjE27TgxkCnX V/Vx24hnhOcIaWm1ExAoV76SuuLXCKYbGHlTYpDLHCcV8Jqu68dGUtXYPJ8rkqn49vgD RHbF7WKvxwqf5B5Fp840ZQXshlinKuKP6BqFON6aiuQy3etV8Wn8Uw8fUxbNXqON/F7L 1k9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JMqLyxGJaMPYorTnqgPPQ67/zhXXKBCrl5Mw2WUKHrg=; b=DMdiJnyLY7y3MrbepnW9blMr2P4oHGpBdlua5xoSqvsboItn6ngLxVoumPxXVSppBM hWHtQACrq6+hNHc5rvMRVez+N6f2izHZjFb7bvA6QmncbdLsR/k4AXYOCHWD+mzc2+NX +jBjG+LnanBzLXnDPv/SXXS6worDUnXn7LKiNc+Xy+040SgtDBVc0wVjjNNpkhsgFqZT yayhanGQai4HOpcgTxrMDhX+OeKX7iBn48zXIJcP9/QM4ew7P5C67xIo9cqCE07O39hx dHc72eDi63FcXsh2cUMHvp3xLcpB4hrlReQM3dqv/Y31ASz5Aa3nqqPwgjLAXYOaX4H4 3u6g== X-Gm-Message-State: AOAM533GcreP97c6AMiSPQV85aw+PmOHAtYLwv/T5hnzP/yvgymtSGzB 3xcjaAs50cDEIUUZ7tkLWbj9VA== X-Google-Smtp-Source: ABdhPJy3VmANSDzIEEm9AR9nJE2H3wW+RUW+nUZTPcuck3azBAOf+c+GjFUe9USX74uY3FjmLAGqug== X-Received: by 2002:a17:90a:11:: with SMTP id 17mr1634839pja.66.1605746270214; Wed, 18 Nov 2020 16:37:50 -0800 (PST) Received: from localhost.localdomain (p784a5642.tkyea130.ap.so-net.ne.jp. [120.74.86.66]) by smtp.gmail.com with ESMTPSA id 17sm6964297pfu.180.2020.11.18.16.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 16:37:49 -0800 (PST) From: AKASHI Takahiro To: lukma@denx.de, trini@konsulko.com Cc: xypron.glpk@gmx.de, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v2] common: update: fix an "unused" warning against update_flash() Date: Thu, 19 Nov 2020 09:37:19 +0900 Message-Id: <20201119003719.14186-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.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 Since update_flash() is used only in update_tftp(), it should be guarded with appropriate config options. After the commit 3149e524fc1e, common/update.c will be built under either CONFIG_UDATE_TFTP, CONFIG_DFU_TFTP or CONFIG_UPDATE_FIT. Since CONFIG_UPDATE_FIT, hence fit_update(), doesn't rely on update_flash(), the compiler may cause an "unused" warning if CONFIG_UPDATE_FIT=y and CONFIG_UPDATE_TFTP=n and CONFIG_DFU_TFTP=n. This is, for example, the case for sandbox defconfig where EFI_CAPSULE_FIRMWARE_FIT is enabled for test purpose. Fixes: 3149e524fc1e ("common: update: add a generic interface for FIT image") Signed-off-by: AKASHI Takahiro --- Change in v2 * modify the commit message --- common/update.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/update.c b/common/update.c index 808be0880dfd..a5879cb52c41 100644 --- a/common/update.c +++ b/common/update.c @@ -29,7 +29,7 @@ #include #include -#ifdef CONFIG_DFU_TFTP +#if defined(CONFIG_DFU_TFTP) || defined(CONFIG_UPDATE_TFTP) /* env variable holding the location of the update file */ #define UPDATE_FILE_ENV "updatefile" @@ -99,7 +99,6 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr) return rv; } -#endif /* CONFIG_DFU_TFTP */ #ifdef CONFIG_MTD_NOR_FLASH static int update_flash_protect(int prot, ulong addr_first, ulong addr_last) @@ -216,6 +215,7 @@ static int update_flash(ulong addr_source, ulong addr_first, ulong size) #endif return 0; } +#endif /* CONFIG_DFU_TFTP || CONFIG_UPDATE_TFTP */ static int update_fit_getparams(const void *fit, int noffset, ulong *addr, ulong *fladdr, ulong *size) @@ -233,7 +233,7 @@ static int update_fit_getparams(const void *fit, int noffset, ulong *addr, return 0; } -#ifdef CONFIG_DFU_TFTP +#if defined(CONFIG_DFU_TFTP) || defined(CONFIG_UPDATE_TFTP) int update_tftp(ulong addr, char *interface, char *devstring) { char *filename, *env_addr, *fit_image_name; @@ -340,7 +340,7 @@ next_node: return ret; } -#endif /* CONFIG_DFU_UPDATE */ +#endif /* CONFIG_DFU_UPDATE || CONFIG_UPDATE_TFTP */ #ifdef CONFIG_UPDATE_FIT /**