From patchwork Tue Aug 13 12:43:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1146315 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QNl+gZco"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 467C8L28tbz9sDQ for ; Tue, 13 Aug 2019 22:44:15 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 23488C21F45; Tue, 13 Aug 2019 12:44:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 445E8C21EA1; Tue, 13 Aug 2019 12:44:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D0729C21EA1; Tue, 13 Aug 2019 12:44:06 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by lists.denx.de (Postfix) with ESMTPS id 7F84CC21E79 for ; Tue, 13 Aug 2019 12:44:06 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id y8so1675472wrn.10 for ; Tue, 13 Aug 2019 05:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rXm2C9uAV7XdFsrrDs5xGxY1bIUwMEjI74hspO4FVCg=; b=QNl+gZcoNQfUMgocij2ZqjD8TyvTYbQK/+iEglMBhLLOff9lnx2qR5JT+xYw2oDG2B lggG53GDGZB5xZljDcBXED0MBLb0zMM3sFnKiGnJ5EwyNpPwGL+xSGAL57fWsaF1iN5f BwxWvhJLT5sW6b4Aq6+twkdM7Jv0hzPha1BuqaC4PLDntKa41G4R5eoNFML8qbEoCU/P AGMebitdu1ua20TRkzLQTAkmN0zud4Jkuv2TWX43kmki12tHyHUwcQL4kXuP6HrWjmjf kgUy365U9zmEilT349JI8ScOHPEozJVvcwYHkuypKUBWptsevx0dpHEmPjD6txpA5c+N HwBA== 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=rXm2C9uAV7XdFsrrDs5xGxY1bIUwMEjI74hspO4FVCg=; b=QX5Za1t0RFLr6OKir8P4cxp9mfH/1mH8NjnQyzUuRDFH7JzqO3wXK2qoXJjcGSXUg2 pSMk6c2oVb59kOn9NDri5bBgZeiiBoS/3Wl8xSIkhAFhv2mhdFF9l4xj0sjoyqmu9t3H Ohx1zN91SEFVzwkaExa6NUNkkYmJ2o5Ml79+DKyIOj/vbUCRN4h4I7PhPx1nC6yBnTSa 7I47+ozJypY1zbX9/iG+w3yWw8GuYlrsUNGhkK4/x8udHzMADognYBBG/syVjpPVSq8z 2ADKxDZjJRPMMJYU4TJVZuTMSTN8C4+lzR4shrkHREQqxtM+VOn/mW0fEIyJpn66FBus KRnQ== X-Gm-Message-State: APjAAAW9VqbbcpQfxeh3ATY2Zvww8oFVMUuVpa0SsuVqWr+r+0bI5lA5 ScjGPcFrMSq2oZe2mxgpkVzl9X0a X-Google-Smtp-Source: APXvYqzcSumfaKseSnsGX5idW+2jfQp+Ff4R+kdAAWAS06cmK3u48eOF7qP3l27l3uCnJB7kjpANVA== X-Received: by 2002:adf:f386:: with SMTP id m6mr43364424wro.313.1565700245776; Tue, 13 Aug 2019 05:44:05 -0700 (PDT) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id u8sm1065701wmj.3.2019.08.13.05.44.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Aug 2019 05:44:05 -0700 (PDT) From: Igor Opaniuk To: u-boot@lists.denx.de Date: Tue, 13 Aug 2019 15:43:36 +0300 Message-Id: <20190813124336.25945-1-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Cc: Igor Opaniuk , Ryder Lee , Marcel Ziswiler , Peter Ujfalusi , Breno Matheus Lima , Julius Werner Subject: [U-Boot] [RFC PATCH v1] common: fix building image.c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Igor Opaniuk Wrap image_decomp() and all dependent functions with !ifdef(USE_HOSTCC) macro, as this function isn't used by any tool from /tools. Without this it leads to compilation issues (because of CONFIG_LZMA from newly added #include statement, which pulls all these definitions): In file included from tools/common/image.c:1:0: ./tools/../common/image.c: In function ‘image_decomp’: ./tools/../common/image.c:428:9: warning: implicit declaration of function ‘gunzip’; did you mean ‘munmap’? [-Wimplicit-function-declaration] ret = gunzip(load_buf, unc_len, image_buf, &image_len); ^~~~~~ munmap ./tools/../common/image.c:450:3: error: unknown type name ‘SizeT’; did you mean ‘size_t’? SizeT lzma_len = unc_len; ^~~~~ size_t ./tools/../common/image.c:452:9: warning: implicit declaration of function ‘lzmaBuffToBuffDecompress’ [-Wimplicit-function-declaration] ret = lzmaBuffToBuffDecompress(load_buf, &lzma_len, ^~~~~~~~~~~~~~~~~~~~~~~~ scripts/Makefile.host:114: recipe for target 'tools/common/image.o' failed Fixes: 2aa7f0fa51 ("habv4: tools: Avoid hardcoded CSF size for SPL target") Signed-off-by: Igor Opaniuk --- common/image-fit.c | 5 ++++- common/image.c | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/image-fit.c b/common/image-fit.c index e346fed550..a064f38510 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1728,6 +1728,7 @@ int fit_conf_get_prop_node(const void *fit, int noffset, return fit_conf_get_prop_node_index(fit, noffset, prop_name, 0); } +#ifndef USE_HOSTCC static int fit_image_select(const void *fit, int rd_noffset, int verify) { fit_image_print(fit, rd_noffset, " "); @@ -1743,6 +1744,7 @@ static int fit_image_select(const void *fit, int rd_noffset, int verify) return 0; } +#endif /* USE_HOSTCC */ int fit_get_node_from_config(bootm_headers_t *images, const char *prop_name, ulong addr) @@ -1771,6 +1773,7 @@ int fit_get_node_from_config(bootm_headers_t *images, const char *prop_name, return noffset; } +#ifndef USE_HOSTCC /** * fit_get_image_type_property() - get property name for IH_TYPE_... * @@ -2009,6 +2012,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr, } else { loadbuf = map_sysmem(load, max_decomp_len); } + if (image_decomp(comp, load, data, image_type, loadbuf, buf, len, max_decomp_len, &load_end)) { printf("Error decompressing %s\n", prop_name); @@ -2060,7 +2064,6 @@ int boot_get_setup_fit(bootm_headers_t *images, uint8_t arch, return ret; } -#ifndef USE_HOSTCC int boot_get_fdt_fit(bootm_headers_t *images, ulong addr, const char **fit_unamep, const char **fit_uname_configp, int arch, ulong *datap, ulong *lenp) diff --git a/common/image.c b/common/image.c index 6da0513e8b..315ae89467 100644 --- a/common/image.c +++ b/common/image.c @@ -383,6 +383,7 @@ void image_print_contents(const void *ptr) } } +#ifndef USE_HOSTCC /** * print_decomp_msg() - Print a suitable decompression/loading message * @@ -483,8 +484,6 @@ int image_decomp(int comp, ulong load, ulong image_start, int type, return ret; } - -#ifndef USE_HOSTCC #if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT) /** * image_get_ramdisk - get and verify ramdisk image