From patchwork Fri Feb 24 18:10:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 1747624 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=iNFPsX8k; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PNdKl17bkz240V for ; Sat, 25 Feb 2023 05:12:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E69FB85BC1; Fri, 24 Feb 2023 19:12:41 +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="iNFPsX8k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E77385B83; Fri, 24 Feb 2023 19:11:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 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 6146F85B8F for ; Fri, 24 Feb 2023 19:11:04 +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-20020a17090afb8700b0023756229427so3712765pjb.1 for ; Fri, 24 Feb 2023 10:11:04 -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=r1qT8X/e6oNywcf6KRa6TBNZQtqLo1hvBnG50hb177o=; b=iNFPsX8k/ytl+Ukye0aYgwHkGwWTunhxPf/G0dYxf3vaFA4YRclCP0d+OEHjZ6mTy4 AwOaNGKU4/PyFyp1hym8BBvocvU1uezdMppIhhl+mIwnkte5fHwpzxDxAFnrbiHtTHFZ hTYGz1nYImY8O4VCcY/VMESIlLOHbpuf4TEQNnZ6/nYrc/XmwaW7fi6EQXaXo2pUT5CV X6DMMxHldyBsxr0AQ/XRDx7zFSwmwmTtkybQWqdcPhUfIdpmpTVf6Bmad60JAdJa1t6o Q+OisS5iQRIjWcQ6NkAJxR5RdYeut+Qt59SN3D3nol2bOMH9Hjv3FqUlkbq3eg3h/RPX KzsQ== 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=r1qT8X/e6oNywcf6KRa6TBNZQtqLo1hvBnG50hb177o=; b=t0shsTKh5wNGc9O3eBsMpZDU3S8p5Ai03TrzyHqHZnINm+UnSYQji7J0e08V1KHxCA 4C0UCVQOqHFEHIZSV5ay/t1pm0g4Mer5h57hPtaxOAFCHSSqmBz2dXrCt4GBzAZNux1R 0GCgH8L7nwofzVFwU1m5G/mU+QbaSQRem6CjhOJuLoA79YcOvZJn+wvZ2OzD1nF9v7hc y2d0bXSR2NzZO+WPMmzjRe4OmnAhxrdiXA3fOrm3U/em/7FhIF3fjyeI4rt5Ky90rOD4 ZOqjUNqWQW47nfL22DCCMIPkwkNlr42nosazJoc/6xX0cbxrkJ59la6kFca/CQFnfJ3L 6x2w== X-Gm-Message-State: AO0yUKUrcr7wzJsqR+xm54KaITDxCDQzR+s58dpzq+9TRfXNERDnhHym WhFolbkSV9b7HdjeYv/J6Ha8cK0wJFo= X-Google-Smtp-Source: AK7set8i0uMFondIIqbgWJi6dHZnE/ot9Adci2Mvue0L5/Ysougi5C0T7ORxy3qNhu2/w4g07joOvA== X-Received: by 2002:a17:902:f90e:b0:19c:9129:53fe with SMTP id kw14-20020a170902f90e00b0019c912953femr12108803plb.22.1677262262394; Fri, 24 Feb 2023 10:11:02 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 10:11:02 -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 04/26] lib: md5: prepare for CONFIG_IS_ENABLED changes Date: Fri, 24 Feb 2023 10:10:25 -0800 Message-Id: <20230224181047.2775829-5-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 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/md5.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/md5.c b/lib/md5.c index 1636ab93661..20d5e87814b 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -29,7 +29,10 @@ #ifndef USE_HOSTCC #include +#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) #include +#define PET_WDG +#endif #endif /* USE_HOSTCC */ #include @@ -288,14 +291,14 @@ md5_wd(const unsigned char *input, unsigned int len, unsigned char output[16], unsigned int chunk_sz) { struct MD5Context context; -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG const unsigned char *end, *curr; int chunk; #endif MD5Init(&context); -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) +#ifdef PET_WDG curr = input; end = input + len; while (curr < end) {