From patchwork Fri Jun 12 11:02:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1308113 X-Patchwork-Delegate: bmeng.cn@gmail.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=none (p=none dis=none) header.from=prevas.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=M974SI8B; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49jyVx0qKkz9sSt for ; Fri, 12 Jun 2020 21:02:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 896FF81C7C; Fri, 12 Jun 2020 13:02:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="M974SI8B"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6068881CB4; Fri, 12 Jun 2020 13:02:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0706.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::706]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0AB89819B8 for ; Fri, 12 Jun 2020 13:02:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UYksZdkdtx5cyppVqzcva9mk3s5m57a4M0WEZUS9E30oWKOMmPvWP0/lLkfWkin8uD+A5tHPtfwvaF1qDIr2YZJrYa0eh8IqXVG04VlfPiNuXkT0tHdk2dlXM/jEJcXB3ATZlwDFycKSR5jR+cn9xCNbTaqTrvPWriIdr/yT+L7AP9KpmeAN0giLt7HMzxmwp6fy1D9Uw4hOFhnHx9yBxGmM+U4D83NhyD62lyWuIlbK9DJZHC1sphI9JZ+X0kasHgmR+kFeGk0aypFl+in27EHwoKpRgmU2AS6bjLO8Eu3glOfi2UTvJDf9p/ZN2YY16wPyJeTji/xGKHkBBWHLZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TZcaxRYzJttUvCz5+84r4xonWDfKolyr4LIouqepwaQ=; b=LU8SOSS3JqgaotMMVa+tGpQBxEXyV1l1mOVBDa/cyB6rtkIjwe2iEEASSSdd9+Xo4gptqJWXYtaz8pvZCqFswt0Q7/nvFk6pTxYEU2Xk0Phhf8esiV+9Pi+frUmKgdgcgdrxta4hnSiVmVBpa05qHVo0s19gT/+lTE9lexe3v+sEHshdQS4XcW8g4ag035sekYLPaJpZJI0vgHz/CZg4ZXc8gKC/oT7/Aa7ZTpWVZtCJfHMub1YNeXjk2itBs4o3DSqEzJjXVI4J3Ox0z4JnkJyR/c6zwenShlWnRqTULboqjQo+Tybi1SBhNKqpG/qYOvHibZ1AY+3f2V2bHEJexw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TZcaxRYzJttUvCz5+84r4xonWDfKolyr4LIouqepwaQ=; b=M974SI8BNouNuSfSEbiAE3OGNZOexd9C279C8cLtsVT2xqFSfP+MnOt1a7IMmKIMwwO2ErafNYVPGs4+gM1SLpYTHwq/kew5NDxsQX0uUOm/krz2OkwvbLH3wwcALuekiBI3j9xnBAxd/byLDA/R1EzuCIStNRAQNPqF3tDK8VQ= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM0PR10MB3156.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:17e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.24; Fri, 12 Jun 2020 11:02:26 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::91fd:aebc:e8cb:a663]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::91fd:aebc:e8cb:a663%7]) with mapi id 15.20.3088.021; Fri, 12 Jun 2020 11:02:26 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Robert Marko , Tom Rini , Lukasz Majewski , Simon Glass , Masahiro Yamada , Rasmus Villemoes Subject: [RFC PATCH 1/4] common/image.c: image_decomp: put IH_COMP_XXX cases inside ifndef USE_HOSTCC Date: Fri, 12 Jun 2020 13:02:13 +0200 Message-Id: <20200612110216.10355-2-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200612110216.10355-1-rasmus.villemoes@prevas.dk> References: <20200612110216.10355-1-rasmus.villemoes@prevas.dk> X-ClientProxiedBy: AM6P193CA0048.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::25) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (5.186.112.31) by AM6P193CA0048.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.18 via Frontend Transport; Fri, 12 Jun 2020 11:02:25 +0000 X-Mailer: git-send-email 2.23.0 X-Originating-IP: [5.186.112.31] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dec4546b-1813-4b9e-0a39-08d80ec01713 X-MS-TrafficTypeDiagnostic: AM0PR10MB3156: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0432A04947 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yCUrA89vT6dWZXuTf1vEZQw/sQRdc+Sfch02R0BvvZw8rN02vdfQQBVQVwXn1tIBlVSFJxAVW8Ov3B5iLwpBohBITaHQT2LstB9vp/LsWMIIJN3AJNV2Xp+AduMkWd+RA+JZlL/sDIkpbqdsix1Ia0ZM8JTz5uzepQcupshvmgH6y3sPBLNb29kT1PRrohFaet7KOBkork2Yrm9ky4pF6bjrFOAywqHoxf01vkn5+SehGrT3uQGBj5T4gWSifvRmCv3QybI4OtomE+c1mFeZXiSnEUg/jfPzLe7M16BtWbwIgwHmZrAmeMXzGtkeRnsYnifk5luOQXja6l2zYYy1uQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(376002)(346002)(136003)(39850400004)(366004)(396003)(6486002)(186003)(54906003)(107886003)(8976002)(8936002)(16526019)(36756003)(1076003)(44832011)(83380400001)(316002)(956004)(2616005)(6512007)(6916009)(6506007)(86362001)(6666004)(26005)(478600001)(8676002)(45080400002)(66946007)(66556008)(66476007)(2906002)(52116002)(4326008)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: hCKeQjoBr6YnLiDPSEQv0eeGToW5hJa2lOKTsfik9SJpx3o4teWHZkV5fl0tNVtTKKj7GjJHWWGAAh0gzW1yotzOKzZx2felqnhDo5ZkBk0WHbBOBFdeQtoxy7LNyDIvAWP6pyzJJSLfxfb3WPbcsOmYXYOzhfaliMxa1EAc0bvFHLTrIqT0Ks92KYHFb75/EKmdi3/H6a5dGm2hbuW0fD5rVs577tCiaRsZs5yV6T9bPAaajw4lpPvgNUA72W/s74zTr6EwX9Q6KBDMbgJAAHUOjh+bcxvOlC7ntbxtk8A31mLLPxNnq3gm2okUxtJ1nSZZqquXYSmpAJwWati7Qb+KDkh9TIcvra+G9nz8pkd+paXolG78+WxzHvd4GO+4P1hDFJUFOsfAaSECeot0rBg0cA4Y5ZtCnUvJqFpe8FzSvYR75NHIBljQtDbxqjUENr2X7O376X/ilmPTCer5askVevmQGMSk/IwrTfFfbrI= X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: dec4546b-1813-4b9e-0a39-08d80ec01713 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2020 11:02:26.0056 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fSgI2Bg0yH2VMvwaOXU61aUsSnEqx6kRfqfeiwgBwoNlnIoDQFdoiY3TzDltJiGbvfROceX5PKeTp2ZGxK9hc7J2NKlSEy4rbYzNVfadLG0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB3156 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean When building host tools, the CONFIG_GZIP etc. symbols are not defined anyway, so this does not (should not) change anything [1]. However, since the host tools also don't include linux/kconfig.h, one cannot use the CONFIG_IS_ENABLED() smartness in a preprocessor conditional, which in turn prevents one from adding, say, an #if CONFIG_IS_ENABLED(ZSTD) case. OTOH, with this, one can do that, and it also makes it possible to convert say, "#ifdef CONFIG_GZIP" to "#if CONFIG_IS_ENABLED(GZIP)" to make those other cases SPL-or-not-SPL-aware. [1] The gzip.h header is only included under !USE_HOSTCC, and removing the CONFIG_GZIP conditional hence both gives an "no declaration of gunzip" warning as well as breaks the link of the host tools, since the gunzip code is indeed not linked in. Signed-off-by: Rasmus Villemoes --- common/image.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/image.c b/common/image.c index e1ca1a7905..73f6845274 100644 --- a/common/image.c +++ b/common/image.c @@ -458,6 +458,7 @@ int image_decomp(int comp, ulong load, ulong image_start, int type, else ret = -ENOSPC; break; +#ifndef USE_HOSTCC #ifdef CONFIG_GZIP case IH_COMP_GZIP: { ret = gunzip(load_buf, unc_len, image_buf, &image_len); @@ -508,6 +509,7 @@ int image_decomp(int comp, ulong load, ulong image_start, int type, break; } #endif /* CONFIG_LZ4 */ +#endif /* !USE_HOSTCC */ default: printf("Unimplemented compression type %d\n", comp); return -ENOSYS;