From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBD18C636D7 for ; Wed, 22 Feb 2023 01:39:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5A7BB85A81; Wed, 22 Feb 2023 02:39:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="SBX7MClJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 941AA80AE4; Wed, 22 Feb 2023 02:38:50 +0100 (CET) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 7151E85A47 for ; Wed, 22 Feb 2023 02:38:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=troykiskyboundary@gmail.com Received: by mail-pg1-x530.google.com with SMTP id h31so3448246pgl.6 for ; Tue, 21 Feb 2023 17:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oXor9MBndxJ/3mKTlcpofA2K65Ep19AU53g/7Rc+uzw=; b=SBX7MClJ8vxj1fCmXX2PqePPW+0TXtiFaUPYTPBvlp9Q1A/qayFiIQ6R3xD+dAVLm1 +kSXU0rrX6/sdlafDOBqFXR0L1pqQauzNkwSB1HQWN30nppeLN9mkOQ2iVdXrz2Qtv7k bm9+SgBDxpeCRCyFzI/DN8gNL3p1BYIbFWFoYtzm4wRTH95/1nOYRyeEdZzaOku3jTHj TMe8z+SXfWcyPd5Dy8ubZglrR0C8zvVTR87bqhl/Irrz681kzsTIzcpt71h5mIrXZFl3 5UO4vFMJ4sYxCLP0CCI1VXzaAi9WRNVgWbqemvfm+R77O2GjsHkepL8Q50WrXA4oxVzQ gCtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oXor9MBndxJ/3mKTlcpofA2K65Ep19AU53g/7Rc+uzw=; b=qKPT7Llmq27CduBO/2mgN6WM3RRJGwlZSkjSlr32Ec8vDjz6AsA8EcnH3/udnWyQt0 8p7GC9Vd4r6j53GYf4id1Tm18GJ3vIBpDbsj66Y6IB5bhw39aZwgqnbMD2sWN4+Ii/O5 jUfhZ97WVDIZP/WvbhRFrLWcM+ZeE2VWK7+NHztUy4QkRjofM/FbNxJSj+7EsF1/s+m8 GFls7Ho7tbER2BXJhUrfhIPrbJjoip1EG4QSWJhR89wFtzCPMWy+t5go2bmjRxxvfsjS GEbqOFfWJQFx+KptDpccl6bR0WyMD7IsIxE87Rbq4jS+yvp9AnzgYdaja0mRiBYfCfA1 BT+w== X-Gm-Message-State: AO0yUKWK+7zKdjr8iWcoDvMG2lpLlvKS51KeL0dPF9o0kDXXATHWU0Cb u2FtBa1VDvb5gy/eQ243Ayk= X-Google-Smtp-Source: AK7set9VlfQLqGPFkX4zQhyPDBq9mtAGo3SuS6GzqmG6fHGz+UoeKQP4f+OtmB9U+eLnTgs7ztRq8Q== X-Received: by 2002:a62:790f:0:b0:593:befd:848c with SMTP id u15-20020a62790f000000b00593befd848cmr5813651pfc.16.1677029923818; Tue, 21 Feb 2023 17:38:43 -0800 (PST) Received: from OS2.boundarydevices.com. (wsip-184-189-120-117.oc.oc.cox.net. [184.189.120.117]) by smtp.gmail.com with ESMTPSA id d6-20020aa78e46000000b005accb31201fsm4200976pfr.26.2023.02.21.17.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 17:38:43 -0800 (PST) From: Troy Kisky To: sjg@chromium.org, trini@konsulko.com, u-boot@lists.denx.de Cc: gary.bisson@lairdconnect.com, Troy Kisky , Marek Vasut , Stefan Roese Subject: [PATCH v1 02/24] lib: crc32: prepare for CONFIG_IS_ENABLED changes Date: Tue, 21 Feb 2023 17:37:59 -0800 Message-Id: <20230222013821.1144691-3-troykiskyboundary@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230222013821.1144691-1-troykiskyboundary@gmail.com> References: <20230222013821.1144691-1-troykiskyboundary@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean We need to include in order to include files that use CONFIG_IS_ENABLED. TO prepare for that be more direct with using defined(USE_HOSTCC). Signed-off-by: Troy Kisky --- lib/crc32.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/crc32.c b/lib/crc32.c index aa94d70ef3e..b2fa9e06e55 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -11,14 +11,18 @@ #ifdef USE_HOSTCC #include #include +#include #else #include #include +#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#define PET_WDG +#endif #endif #include #include -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG #include #endif #include "u-boot/zlib.h" @@ -84,7 +88,7 @@ static void __efi_runtime make_crc_table(void) } crc_table_empty = 0; } -#elif !defined(CONFIG_ARM64_CRC32) +#elif !defined(CONFIG_ARM64_CRC32) || defined(USE_HOSTCC) /* ======================================================================== * Table of CRC-32's of all single-byte values (made by make_crc_table) */ @@ -184,7 +188,7 @@ const uint32_t * ZEXPORT get_crc_table() */ uint32_t __efi_runtime crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len) { -#ifdef CONFIG_ARM64_CRC32 +#if defined(CONFIG_ARM64_CRC32) && !defined(USE_HOSTCC) crc = cpu_to_le32(crc); while (len--) crc = __builtin_aarch64_crc32b(crc, *buf++); @@ -243,7 +247,7 @@ uint32_t __efi_runtime crc32(uint32_t crc, const Bytef *p, uInt len) uint32_t crc32_wd(uint32_t crc, const unsigned char *buf, uInt len, uInt chunk_sz) { -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG const unsigned char *end, *curr; int chunk; -- 2.34.1