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 B0FD4C6FA8E for ; Fri, 24 Feb 2023 18:12:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1E89085B96; Fri, 24 Feb 2023 19:11:17 +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="Zen2eWIm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4683A85B83; Fri, 24 Feb 2023 19:11:07 +0100 (CET) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (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 3833785B88 for ; Fri, 24 Feb 2023 19:11:03 +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-pj1-x1031.google.com with SMTP id y2so13026664pjg.3 for ; Fri, 24 Feb 2023 10:11:03 -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=0HkyI/TWX3VXaKX2A/s1Da6eyzXq5ERYQgchGC5hRnI=; b=Zen2eWImzYMmkQTZeAQFblLm5P18D92xV92jNcJTM5nssumjq5hjBDfXiGzKubJXEJ B/CVDjkvgX5kuVlDTLEreJ7adb7btz2b6RqxhLVx9TzN85MYByFGy2onMJHwMSo0h3dc ijz+KeEz2BvorH4hrG9YDpf1qRzcCarS47pH8dpEJXPHdmg35FJnRPF3M/iQwDEl3I7s pDnT61QcBwv7H8skcruVufQe2Vifl9MhbGF0xD8Tz1XOv0bKXHQWfgGj6SlX5CbzkFRv rTFTbzDybbmAIUZr3I0LVGikI/64iPQnOrpTdhmQmW2vWZc7/jqsIVdODqfQzDIcqjic xhuw== 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=0HkyI/TWX3VXaKX2A/s1Da6eyzXq5ERYQgchGC5hRnI=; b=vuK0zdd79XSRAAQzXpUIcdO8FsXv4CRKh/UvSe09PSTdNMk376yPWAhA5fX8tx1WcD L81rCLdhs7crKhfAUhNJkrXA47JYDHWAswwSr6QiuB5DMCDil0gXai1Gi63Lefnshnlg C5ihyAp7uk8ZR202ecYn4RAz+WLIgl7MN9P2zbPlr9NtkkjKaDbMvM7xHNL060GZge3n jtR10DChka8ZkT1P6qFY5YieQBiHFpDg3a4wD837z5AHBU7Ij5A0Lzp1zsYjwMOcQa1B PikX2lUtaEQgVtCGIixtm3MFQ9FUocpS3ROaEHwOfx3pU1Og/cc5+hxz/S1O4JOB4BKh M2vQ== X-Gm-Message-State: AO0yUKWytcwXTtCj3oRe1mNPIUloocY55cGKDMYZwmcNf56i8lAzTN6Z Zgln0h4lvQciiZ47eT2JW3Q= X-Google-Smtp-Source: AK7set/tv4sFsEAh4UakK7doXQs2G6oxYq+fxlM/b7G1RqQDiqDWPcwnoGgGSIGPQuU/YOQLNotAEQ== X-Received: by 2002:a17:902:ecd0:b0:19b:2332:18cb with SMTP id a16-20020a170902ecd000b0019b233218cbmr19901045plh.1.1677262261137; Fri, 24 Feb 2023 10:11:01 -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 o1-20020a170902bcc100b0019c922911a2sm7513957pls.40.2023.02.24.10.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 10:11:00 -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 v2 03/26] lib: crc32: prepare for CONFIG_IS_ENABLED changes Date: Fri, 24 Feb 2023 10:10:24 -0800 Message-Id: <20230224181047.2775829-4-troykiskyboundary@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230224181047.2775829-1-troykiskyboundary@gmail.com> References: <20230224181047.2775829-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 Reviewed-by: Simon Glass --- Changes in v2: - delay include of linux/kconfig.h to do from Makefile - as suggested by Simon lib/crc32.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/crc32.c b/lib/crc32.c index aa94d70ef3e..12c104c62a4 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -14,11 +14,14 @@ #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 +87,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 +187,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 +246,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