From patchwork Tue Nov 17 00:26:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 324534 Delivered-To: patch@linaro.org Received: by 2002:a17:906:d156:0:0:0:0 with SMTP id br22csp4490680ejb; Mon, 16 Nov 2020 16:27:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZv3lX7oxLViBnWJLbr/w3DJwH2cwacrLbcDcnorUqjuIA+jFhY5mE7+2kwLUkEmHvszGn X-Received: by 2002:a17:906:ca93:: with SMTP id js19mr17980055ejb.537.1605572852000; Mon, 16 Nov 2020 16:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605572851; cv=none; d=google.com; s=arc-20160816; b=Lw+HqgFtPF4szgldUOjFZtyHxFsdU0f1FcIp6zLOlzycyR8e2bgpJyCISvbQuwYQT1 RCbjOyd63BrLmO2wT04O4v5TDBvmjWo+2ZbvJmaw82hAIjV0yBj+pdcMOzxjwiIJK3LP zGFT54y9GFrGmgZRCZxghTrzn5jX4CMjaHPGKC8QAwoVbNJrW4M/ZlyF9vwKa4HSlbWw sXJyrZxitWfqPvTQ68YtWKVSL7PRzWFc5/X/D+2cFVtQYrO+tVhe70g6bCnkUoNVvQLb pNWDihlPMlKdbQfjo9DHKyFetvUsgUI9bqXYLIJ05oi1ywJr5SqDBpPoqjP99HqTpppU lBGg== 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=GEkPjburznKZXe3RT/LuSN1inrL+KwsNcNt+tBFkrw0=; b=mDaBb+V2MDTpeME7aGDbPV+orqlwiRaXS1hsgHJRUdqhtGIg0JdwXH3t+Q5h9eKx9m N9EtSABS3Asp4DMliEGIgWj3idM5HCO0BQrKvIqyFxelnLblUM1mVVtaYWf8VqHkw4Bt V7fqVcGzL/ifpPCNWpZk36StnAyemem1wr3uaC63XhXanqHiAFDLiz+jSwNT2cpEer/M Yp9N5bu4AU4MRHqi+Jk0q2QoxrlfTC81rocQcWpGAoCzSJOqwrGhUMz10vuyd/8PP+03 EmM118iTY9WJjvRB+OcfR/aHZcrU4qV1rNYCiqtS0sZ0pYl/0YHwgSoKudYP4QqhR/7i ehcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uTkl8HHQ; 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 q9si2483311edn.33.2020.11.16.16.27.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 16:27:31 -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=uTkl8HHQ; 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 722A882304; Tue, 17 Nov 2020 01:27:23 +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="uTkl8HHQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 818B782366; Tue, 17 Nov 2020 01:27:16 +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 D3177821F7 for ; Tue, 17 Nov 2020 01:27:06 +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 m9so5126083pgb.4 for ; Mon, 16 Nov 2020 16:27:06 -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=GEkPjburznKZXe3RT/LuSN1inrL+KwsNcNt+tBFkrw0=; b=uTkl8HHQaV0O+N6XD4ZFdeMgBrb4IzDdUFxSENpYsVQyWeWzD6eKJ7Fzp2+w+wfh7Q 1jsi1DSk5Lh1UFbGQOa5bojKMWiJcGI+jmpy0RDuTO+HM1MKq+0vtrZFPuj7i0s/zr34 HcNEcDAAbYiB+9U0SuFIxZlt7JyrAaaWnyiuCgUyloToYJuY1HeC/Xgaxw43n7DlvCVS u6piOHJEFPBHo1IjoYmzamS9dARZNeidQwpqgMJJ7uzHdE48wsn1aPbm83VcnXIApA+R d6r5lkVrY4S47e2re+qjZzyuonj3k7fVx/J9f6hisn/NoD7trEFcrNKR6kAkylwYKBxw xsxA== 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=GEkPjburznKZXe3RT/LuSN1inrL+KwsNcNt+tBFkrw0=; b=fw3aSKdJ+qGGgxnoDjw8srOOvJ3AQmoM8CQFMCyBBrS6G0mryCzrF0xXa5s0zt59XH yun4dtKjFVicO8+YazO85H7vBycj4K082Z3pDboZpZKuLy5F6CGkeesB8H1md4t7wcI7 Y03fFdCq4uRQBcKN9ShDxBFvzijOmHlrC4FVepAmnTfuqwQ34cNFI9SdwUOp083ojScM blwkXq20RAnMmpCD6lpEVudETNvErJjAII5NjJiUzLNh9W4ZnfXjWdgWo5SUpdJEorB9 gfMx6pE6cggy+/uPNG8lacvrPPjia6uw+NNMKWIDsFTZ7kexJYNVrmLC2TlZkzsgueAg g2Sg== X-Gm-Message-State: AOAM531rB/cL+zTf/sf6cdwboeBssBQMm9ipJpu47h1iRKWGPmGMvsfL cYI0l25Rm6+f2SR2Ud6j50YgKg== X-Received: by 2002:a62:8053:0:b029:18c:733f:fd88 with SMTP id j80-20020a6280530000b029018c733ffd88mr16083246pfd.69.1605572820280; Mon, 16 Nov 2020 16:27:00 -0800 (PST) Received: from localhost.localdomain (p784a5642.tkyea130.ap.so-net.ne.jp. [120.74.86.66]) by smtp.gmail.com with ESMTPSA id v126sm18959616pfb.137.2020.11.16.16.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 16:26:59 -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] common: update: fix an "unused" warning against update_flash() Date: Tue, 17 Nov 2020 09:26:46 +0900 Message-Id: <20201117002646.13750-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. Fixes: 3149e524fc1e ("common: update: add a generic interface for FIT image") Signed-off-by: AKASHI Takahiro --- 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 /**