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 D204AC6FA8E for ; Fri, 24 Feb 2023 18:12:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BAF2085B85; Fri, 24 Feb 2023 19:12:10 +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="YgBdra/w"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A106385BB7; Fri, 24 Feb 2023 19:11:14 +0100 (CET) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (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 92A2285B99 for ; Fri, 24 Feb 2023 19:11:05 +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-x1036.google.com with SMTP id cp7-20020a17090afb8700b0023756229427so3712867pjb.1 for ; Fri, 24 Feb 2023 10:11:05 -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=5SVqu5YSrsS5ZjeATX/3GjDTJb4mKd6JmhdzQRSU1mQ=; b=YgBdra/w73l0kKUT6K8RnqxMuf7mgr8ZZqo63HCB0kl4UufozQ22OBUh2rL4x8Gj0Q i1gGYm5bFvhPeMoD63T80vvvgO0tauCZ0cC7v+dla0H28gO+ZTxmo/O0wxxzF0EgEEgG CqDF6XJn0Yd7xK2EvCMnO/zNZQHvP8YypUcTD20geF2NBKsyYMVOBY/JbKxHQGyC9aIm Hc8snn2vCtCZgkDAXopcXhZoIGygIa17t6sy1PNHEmFwlmwDhJd+yQvh/ZuGb/14Dxj4 8o2NsuJ3V9cNBc7KP6AKjQceusdoq9uaRnudvpCQoqIfIlG9HyRszvTpuzTpG2j32ypV 5ZVw== 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=5SVqu5YSrsS5ZjeATX/3GjDTJb4mKd6JmhdzQRSU1mQ=; b=re62/ROYdgtma5KwsSWELSmN1ZryqKsobj3qmjT5yfhYtfjDQl8J4Ssoc8HzVtNgu6 oXKiaOYh4Nt8CJn9OlRXW9y1jMVt2p4iRv/JCOs6hx2RTWlK5KWvE98YnRE7oE9FT5yf ZyBhEAF4DgZT5ZivmYaFYK9IjPqZJRvIMH8xF+4z0RwXCvLqB8uMkDSBxsWVYVS9kjZI ByO7Cicxd4OzH2B1eFrsoiiunkUOzTNKpCeZpKPE/nFYEks7R2v2dawYIloe5PG/np2+ K1W0BqKb4XkmrbRpsUeJRwIcibH5T0LraEP8RROXEeFKxC5ZsoJ1ozfnjSqWmgvsqgX5 cqHA== X-Gm-Message-State: AO0yUKUmi77ohOJO3bFD+vMScb1jGPFMDL9z3AdRSCqkn9D9PjiGJ2fa n0ptGREgmq31V9XcIO5kQoZaylGi2JM= X-Google-Smtp-Source: AK7set9mUCVIObo+rXuhd4Ji2NnC4E+MaM9y9MpnYZ1b4W5yC5WN82DcXStPL7ywfJgdCBWeKSIUmg== X-Received: by 2002:a17:902:d2cd:b0:19c:192b:e80f with SMTP id n13-20020a170902d2cd00b0019c192be80fmr18884509plc.54.1677262265109; Fri, 24 Feb 2023 10:11:05 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 10:11:04 -0800 (PST) From: Troy Kisky To: sjg@chromium.org, trini@konsulko.com, u-boot@lists.denx.de Cc: gary.bisson@lairdconnect.com, Troy Kisky , Loic Poulain , Marek Vasut , Stefan Roese Subject: [PATCH v2 06/26] lib: sha256: prepare for CONFIG_IS_ENABLED changes Date: Fri, 24 Feb 2023 10:10:27 -0800 Message-Id: <20230224181047.2775829-7-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 don't pet the watchdog when USE_HOSTCC is defined. 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/sha256.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/sha256.c b/lib/sha256.c index 4d26aea1c8c..8e1c3992674 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -8,6 +8,9 @@ #ifndef USE_HOSTCC #include #include +#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#define PET_WDG +#endif #else #include #endif /* USE_HOSTCC */ @@ -276,7 +279,7 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen, unsigned char *output, unsigned int chunk_sz) { sha256_context ctx; -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG const unsigned char *end; unsigned char *curr; int chunk; @@ -284,7 +287,7 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen, sha256_starts(&ctx); -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG curr = (unsigned char *)input; end = input + ilen; while (curr < end) { -- 2.34.1