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 646F8C61DA4 for ; Mon, 13 Mar 2023 21:33:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59D8085DBC; Mon, 13 Mar 2023 22:32:13 +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="NqhrqaZN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1243985DAA; Mon, 13 Mar 2023 22:32:08 +0100 (CET) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (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 6F06585DB4 for ; Mon, 13 Mar 2023 22:31:58 +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-pf1-x42b.google.com with SMTP id bd34so8532421pfb.3 for ; Mon, 13 Mar 2023 14:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678743116; 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=D48xtZOylkHjjC9nI9h3arO631yiEfUEDhd8y4BO0EM=; b=NqhrqaZN1xekh0SrimPZvwV8tw+o3d+qjZztj0n/vLD9F1/696c0CvtytxElGzMAew QXP8dTDynbcOh+RzOqrpLZu+xoNBKoKa8mObMJF6Ox0n9JBTB/RqkNZlZisQMErMEyHH ivHN+yZDMSPJASOmBTnP4DtX5ax0AKhHC1OqKQWlf87ZWCY6xLI8LSkBvOzxKQSinFKj NzNCrVVSTZNTs2bU6Ow0nVDD4llEaJVlupabnxqXG8EsJm7SvPvqt6GjOGQxpl+qmLvs 5ib2A5G6fEr2BaXy+mUo1+o+Ox8X/qj4nqbPgaZrXPJJSVruejDaREW/vG7yj33YsV3i cpRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678743116; 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=D48xtZOylkHjjC9nI9h3arO631yiEfUEDhd8y4BO0EM=; b=RoJJPIbumSnPRExGd29E20h7iM1HtwFld3jQYdNLLoDhGGW9NrjdYNyYyEq+SrBQYt 5yXQ9MTFeDcihrs54IE5DoX6HzxDuIo+EJyrvq/TWW2nzFNxOjtB2zGTVJUQIZtJoJVI GheB1vrpXyo/YzobD9u5Uz20iLaVAB2RfgM5dLc1Fqtq39lUDd//bxrWvF9l50TyMWHB dwHZhMslstvQnDlsi+AfIqCmGisB+TjhI1h77wnE0yl92iuPqArOicZcrFpMgFAMSY7q ilk1JqxTUVjtI+lxEFCKHr4txLu64j7f1tA9E7jGcyKxUaSnbs7XUiah9DmU76m/KVR6 2tKA== X-Gm-Message-State: AO0yUKXEB6jvMSJZgBWxbYNbZ5whVlSZnB7ow2BVRC6uCvoi6dGAufhr hkk7TsjrvqrIlveoT5jDBBw= X-Google-Smtp-Source: AK7set++ZQcbHeuY6+DKdnzIJLOV8gCfARsntZdPs9UHZEp2A40DNuptLNrCItKrR3Oo5iQrQnE81w== X-Received: by 2002:a62:1991:0:b0:5e2:434d:116b with SMTP id 139-20020a621991000000b005e2434d116bmr27138532pfz.23.1678743116409; Mon, 13 Mar 2023 14:31:56 -0700 (PDT) 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 s24-20020aa78298000000b005d4360ed2bbsm150797pfm.197.2023.03.13.14.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 14:31:56 -0700 (PDT) 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 v3 03/23] lib: crc32: prepare for CONFIG_IS_ENABLED changes Date: Mon, 13 Mar 2023 14:31:25 -0700 Message-Id: <20230313213146.1775650-4-troykiskyboundary@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230313213146.1775650-1-troykiskyboundary@gmail.com> References: <20230313213146.1775650-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.8 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 --- (no changes since v2) 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