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: 328372 Delivered-To: patch@linaro.org Received: by 2002:a17:906:d156:0:0:0:0 with SMTP id br22csp910036ejb; Wed, 18 Nov 2020 16:38:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwn9oz6S2iyebHHkWFU3KOSr6jY+Af/L4yUkMMoIn0ZJUYvp70/XV+osORzh0q/cXWnY7EC X-Received: by 2002:aa7:c546:: with SMTP id s6mr28042116edr.114.1605746280644; Wed, 18 Nov 2020 16:38:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605746280; cv=none; d=google.com; s=arc-20160816; b=tDM1wV6QNyGX4q5rtAShFMz/Mo+n0tuN8Fmz3vgHwwoZnIscizQWLzzohSj9lmut3D XzCGHFzAkASFfs9/XzX0mKQ7qriDHtgHUlR7RpbHAXbCtkEFys3k+vqUPlQtjOwhLnUm FTJED4KQDTYlSOmfEbmqThpodBcf+X7I9qKPjn/01YCae9fCrVG6sL/8Hx1hWXRQ6B0r Oy57SdmBTYGtNbBSzvZmA7wy7aT8VwEVq+XQVOcev5zPQAX/Ohvl3IpcPSDupkkJriPL gB/TC4jkq1TrB1RrHPx3WVhONSudkGkEjHWzynIwiCBSxNeKEgb5PQQQ/kfe1jStmKmU ovSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=JMqLyxGJaMPYorTnqgPPQ67/zhXXKBCrl5Mw2WUKHrg=; b=OJGhwogNpooy67kVcTBy1ZOOtOizM70/KOGW+s6T8H3uv/acMVXTwn4kRInCcad82f qvE2LTE+tZzrbTiWkabu0sviOAgsVmD1cOvhE6HtxCBL2K7PBU+BHorER5LXJiaWQD6j drINVPXFSAR1y7wTiQtjt1qaxDqbQ0ObIdmSCsqs4YPCLSQC4F77pBQPAw5Xi66ri41U OEEMHTH+F52PPhbAiH8/qvOecpkTBqWoFHlNC39UO6NFVs05rm4Tdq5OylcQAlhKy+rm wgQ3x0oaJvSLUhlX0cO+aCmD5ScbESFj6O0qTDpal2wgmfk91RWYe9FELrZgwYjA/tJV unyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tq7VDw8A; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id l14si11433556edv.144.2020.11.18.16.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 16:38:00 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tq7VDw8A; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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(-) -- 2.28.0 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 /**