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 AD530C61DA4 for ; Mon, 13 Mar 2023 21:33:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 82A0685DDD; Mon, 13 Mar 2023 22:32:27 +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="gtqvsYu3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0AFBA8613C; Mon, 13 Mar 2023 22:32:14 +0100 (CET) Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) (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 E98FC85DE8 for ; Mon, 13 Mar 2023 22:32:00 +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-x42e.google.com with SMTP id ce7so8510529pfb.9 for ; Mon, 13 Mar 2023 14:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678743120; 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=TeC2mM/3NW5s0/UEux6ourCyaKaVK7XHIRir60jkxbo=; b=gtqvsYu3/Vz8mQD6Y+17pZ5IJr3+Oogk7rYsA+yF29LIdaFqR/4bouYZAmm0Rb6UXy zoe8xui++iIvZvCJQiaWkaLQ7yBp+dP63zZrnrl3jfCsgwTvPEwx6RLcU7gV2XFGiql1 GeKxMSRtOM8HdgyCRuQ4c/aEoaI0Z0pBIg/56KrLvevntN0fFXXUj40WVsJ6K9au48zz wREfyrWiOrd9adIsVCHicikC1Gb7p/F77ZMNPAdmE3afSDRDt+erIy8jdzJQgOL73XLw Qh4nFXjy2lm4Iu4MVGMV65mSxpCrueiKf6P32nX6EshQNrjMLUH7KxEOn6ZMxxKkKJ7f JvGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678743120; 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=TeC2mM/3NW5s0/UEux6ourCyaKaVK7XHIRir60jkxbo=; b=VQlimMkoWwc3WgwarC6Gs7yIviq1nO5OYBV1UhcEXDzuqY2p8aQN3dTP62ed+D7bqK kNduQV5BhlmUFcQClO078sxs8ip4kYk4LC+xrvc8nmxTbX/2IyqHXFG+GsLWmXGtzRHd LSaU45QTsZcmzeWwIl8QXu+hE408ZIFqluF299msudrSY89sa+56UiSG+PAPmofr3rwj tquMPr26OYzbvVY9buelKwUa6s/YCVqE4wtlj86F2Cdx36RKso2q3zC9LWW/s8hoqjp1 2CjMtE2QsBuBBL3L8gz9e6DfpmGXTJjK5caGu/OSg/0eRoQEEO+yi9bqe+wPCuRawKw8 RRUg== X-Gm-Message-State: AO0yUKV8SPfYOM2xc1zYLJLkqkSPT3RgC+7Q+K5UtHI/P12ITyoHNElD UTtrZwl2cO165nigh+8fdqy1PWP0YqU= X-Google-Smtp-Source: AK7set9QTVrJMfPgB6c43cBXIx5SYQnjzhZpyVtgGdUE9SWtMu+0n0BZMNUHDRovnz+gT9P3avVLRg== X-Received: by 2002:aa7:9485:0:b0:600:cc40:2589 with SMTP id z5-20020aa79485000000b00600cc402589mr30321211pfk.3.1678743120439; Mon, 13 Mar 2023 14:32:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 14:32:00 -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 07/23] lib: sha512: prepare for CONFIG_IS_ENABLED changes Date: Mon, 13 Mar 2023 14:31:29 -0700 Message-Id: <20230313213146.1775650-8-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 don't pet the watchdog when USE_HOSTCC is defined. 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/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