Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp411454lqt; Thu, 18 Apr 2024 22:02:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIXtqowkoFwdNAbeWFLIhvwRRKBsxOvsFw/wu5h8CEVbCjAqZ7tbdn/MFhp49hVG+iG84KcBHNZNw1iwZCGfXLvPm+tYVjJeRooTpthw== X-Google-Smtp-Source: AGHT+IFNRfH74t/DdmLE0vstgS+wFQq76tUnXfveo9FOKL5/KLkzch52TeWyuMsKkHSRVRtY8gpq X-Received: by 2002:a50:f616:0:b0:56e:99e:1fac with SMTP id c22-20020a50f616000000b0056e099e1facmr725002edn.39.1713502973837; Thu, 18 Apr 2024 22:02:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713502973; cv=pass; d=google.com; s=arc-20160816; b=uMnRY7mPKCyOl/W4HruhTBsg73e66UTkkx9YLTzMB+eaUMzaw4KsHh/ywsKB51uI/0 IyZHMhxV8+KWphv0GzEqWHBfjYVwICxDgVYQWmMhOYX+UoelxbxkJkGI6tKX352hR+tJ 7p2qNOPtwOs0QcW3Ry8INArA8qk/+JJg7ud2NipwWmQGhkkxVAbW3RhXqeAOOhN4RzUw xtOymF2ujio7+ljOqV/doI09/JnYVjdryyI2YSqJ1M141QeP45bfxdRmwYC2T+55pwdS 2KePQEuImBSOkaHog/osyCgiKjbtLQwP3qggsUnEemcj8DSaafYYWqW9/GT067lffHH4 567g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=/7K16+lFmr4GqBnQeBVfOAuaKd9QSck1GMug9WoFvSw=; fh=yT/1B276qWXj1dSLqqEKiMaTwSYIInkftguVP37bbiQ=; b=gBinLoXq2lnmmsx0Ul2ZzcGHikmMcbT9xcmijiiVAktmoIHwn4sN1gTEDNHoaKd7rt NY3diwFYg3UkWbi3cyFqapVYO1BmDdIrl9I14ewUGCIDJPmLR5p6ssAbTd3e6Sx5JHXH Sk/CrAFiWV16OcOfeqwQl//6Wj79g3fZkwp1QclfmYbk+oowf4FLlx6ilR0PXsRgSXKL tLVJNSrVugfcwmxBicknPvu3J8es0M90o7vubGn4RdCdgQh2EaKki0B3AuyUP5KH3p2H MlG+9dj2NIS4aNrC8oubhiUjf2Ag8XVHgAVKj3dFcz30JXkE15Ku/dqKJGSHIS+mdOkH 1xSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b="hvx9/2A8"; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-crypto+bounces-3689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u18-20020a509512000000b005701f1df4ebsi1631125eda.447.2024.04.18.22.02.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 22:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b="hvx9/2A8"; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-crypto+bounces-3689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 893331F2241E for ; Fri, 19 Apr 2024 05:02:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F11D7494; Fri, 19 Apr 2024 05:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="hvx9/2A8" X-Original-To: linux-crypto@vger.kernel.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.subspace.kernel.org (Postfix) with ESMTPS id C4605C8DE for ; Fri, 19 Apr 2024 05:02:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713502969; cv=none; b=uGTY0hTLik0wmf4vE3L0gPj6WxFxxAjjZIYn/wFMFqIANWYerj62lajxT4CjMtk6Gpv48+XAwnsyvWxXUOsh8Abts9GKOPL3S3KFu5AXWAFvSaOkcV4bpOi6VWOKIP2WwxMQxD/Wgo7+9GvFJ1YX1CIfDC76k5PWWshqIzYCLuA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713502969; c=relaxed/simple; bh=klXsnYwRxUuk8G3WI88QnoY2DTIIQVgqWQrvc0VV8SM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZhfOXknc2Og89WGDtIvLn9PGxhsze12CpViLntoFfHqSEPSwXUKriICGHdCWJJ7jKGfTHxEbadMNdyuXFsQPNuq5umYCKC0Ar6lg9+qDX0V5i0cuSnCMWO5teGNAgbPQh6R5odBR2Pn9vGtbSNyoBX5CZCLKOihxbttd8Wf+6X0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=hvx9/2A8; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id DDF178860F; Fri, 19 Apr 2024 07:02:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1713502962; bh=/7K16+lFmr4GqBnQeBVfOAuaKd9QSck1GMug9WoFvSw=; h=From:To:Cc:Subject:Date:From; b=hvx9/2A8C66P7Ncj6RgdVN2zrwlZvYezmUNYIy9IIrbIFJAbMnbIZoDz+toUyofWe CM8gEv6pWbQVu7mmiIvIaHVy91BtdOFRD7j6ublgWaGsiLnYArlH9EA16MqtLQwi8K AFa6Ku7UhlUE5G8SeJD2CdoHMRBm3cXkdwsZO+MQjFX0Xz4UshAmuAOnBz3HpXaH4U JQGgDLVPkORbskbWgvZZhUMLFqN8pR0pijJdZmDYgO5o+o37i0XG2v0Bsml85zXU8C v8XxQ9hmp1u6Nyx48Zv5vFb3NF5TFbqXZ2GU/8OvnBbA28Df2nvVO50HLN+lsk4kVV YNK8TJWNJtbwA== From: Marek Vasut To: linux-crypto@vger.kernel.org Cc: Marek Vasut , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Alexandre Torgue , Gatien Chevallier , Herbert Xu , Maxime Coquelin , Olivia Mackall , Rob Herring , Yang Yingliang , kernel@dh-electronics.com, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 1/3] hwrng: stm32 - use logical OR in conditional Date: Fri, 19 Apr 2024 07:01:12 +0200 Message-ID: <20240419050201.181041-1-marex@denx.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The conditional is used to check whether err is non-zero OR whether reg variable is non-zero after clearing bits from it. This should be done using logical OR, not bitwise OR, fix it. Fixes: 6b85a7e141cb ("hwrng: stm32 - implement STM32MP13x support") Signed-off-by: Marek Vasut --- Cc: "Uwe Kleine-König" Cc: Alexandre Torgue Cc: Gatien Chevallier Cc: Herbert Xu Cc: Maxime Coquelin Cc: Olivia Mackall Cc: Rob Herring Cc: Yang Yingliang Cc: kernel@dh-electronics.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-crypto@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com --- drivers/char/hw_random/stm32-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c index 379bc245c5202..1cc61ef8ee54c 100644 --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -353,7 +353,7 @@ static int stm32_rng_init(struct hwrng *rng) err = readl_relaxed_poll_timeout_atomic(priv->base + RNG_SR, reg, reg & RNG_SR_DRDY, 10, 100000); - if (err | (reg & ~RNG_SR_DRDY)) { + if (err || (reg & ~RNG_SR_DRDY)) { clk_disable_unprepare(priv->clk); dev_err((struct device *)priv->rng.priv, "%s: timeout:%x SR: %x!\n", __func__, err, reg); -- 2.43.0