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 CEB6AC7EE23 for ; Fri, 24 Feb 2023 18:13:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A24485BA2; Fri, 24 Feb 2023 19:12: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=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="VQUu2vxl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1545485BBC; Fri, 24 Feb 2023 19:11:15 +0100 (CET) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 40B6685B82 for ; Fri, 24 Feb 2023 19:11:08 +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-x102b.google.com with SMTP id m8-20020a17090a4d8800b002377bced051so3747560pjh.0 for ; Fri, 24 Feb 2023 10:11:08 -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=YtIeDYoMFAotZCf35ECm6QpdzpTKSWzBOb+hLs1Y0nI=; b=VQUu2vxl6UBk4K/ZTfjvAd1H3aUUp1k89VwovcglFRIIN0kBHi6ZIDUpYlm4y7aEJh QQzobhPqiTou0jJINoDH4m7eg1jhoFiGgXXZPWiDDVnOUb+rFuvlhxMsert8sTvEYu+T VJcUqOXovuLgxqF4usTat1i+3S8A87ywcjhpLHKXhrFDAXLyYAV5na2UnFuJKSn4VS3U 0Kky6IJuZvuVmbDsaOoCIwFJMQ0h7/kg8+a1eoenrweJtHk2/hRRXUypsottCEeGlF/R jccefH8PdJquAG5lN7rKSNKpUsVlFnKyNgNyMYUtTXxrSrjKT4HsB5aLNwkhGf7WyvyM gckg== 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=YtIeDYoMFAotZCf35ECm6QpdzpTKSWzBOb+hLs1Y0nI=; b=b6ZUgG952zWU6BxljgvAVjDlTliHIL/RnNsKeFDCPQbXtkl3S51BLrnfEwicz8VZc/ 9HnrSq8dJ/+2Czo+jSZ+nBb20kStr1PJXalWcBebigVWNl/M9723EgeEHZmo73SCSZwU EQZ1uhd6KF/dx838XlaS4rexygrCxKa/MJFyVOz/59QhwhaQShkknK8ozhOLZNWdVZSP fpVYHJ5gxpK/GNnM1edmHgJ1eeKKdV6X5WiXQjo0Lj8XqCzWuEYCP9ZkqTav5G/m+Hlt yieEDHj+4VMi+GC9L03YGeMY3DhtMhNYZuAbhQXeUzL3nHL4BS3wJo+f92dGR2BvIg+/ 5xtQ== X-Gm-Message-State: AO0yUKV1rJqV53oOYQIjXDOo2UElt2EAcj6ul1S3uW2zO1G7WWN6nhps kv4mNn8d9WDDUucSzDNalx8= X-Google-Smtp-Source: AK7set9hTnakeEFRs4HttazKlmw8KQINRMqSiMYDqOUtyHC2LnM0SToyv00eOvM/F1eawFnwBz5jkQ== X-Received: by 2002:a17:902:d507:b0:19a:96ea:3850 with SMTP id b7-20020a170902d50700b0019a96ea3850mr422202plg.17.1677262266495; Fri, 24 Feb 2023 10:11:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 10:11:06 -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 07/26] lib: sha512: prepare for CONFIG_IS_ENABLED changes Date: Fri, 24 Feb 2023 10:10:28 -0800 Message-Id: <20230224181047.2775829-8-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/sha512.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/sha512.c b/lib/sha512.c index fbe8d5f5bfe..a504281bf93 100644 --- a/lib/sha512.c +++ b/lib/sha512.c @@ -13,6 +13,9 @@ #ifndef USE_HOSTCC #include #include +#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#define PET_WDG +#endif #else #include #endif /* USE_HOSTCC */ @@ -292,7 +295,7 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen, unsigned char *output, unsigned int chunk_sz) { sha512_context ctx; -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG const unsigned char *end; unsigned char *curr; int chunk; @@ -300,7 +303,7 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen, sha384_starts(&ctx); -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG curr = (unsigned char *)input; end = input + ilen; while (curr < end) { @@ -355,7 +358,7 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen, unsigned char *output, unsigned int chunk_sz) { sha512_context ctx; -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG const unsigned char *end; unsigned char *curr; int chunk; @@ -363,7 +366,7 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen, sha512_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