From patchwork Fri Apr 19 05:01:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13635691 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1295EC4345F for ; Fri, 19 Apr 2024 05:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=aG1Ks6nLh3MpT4O5/bPaw/QMioHpVocYrUcThFIFjKM=; b=pzAlmLxascQ26T 6mmJxkNwLhGYsvWfQeh9pD1THhZS13y6yK5MBKhgl2RcxUgoq6kiwA2AVcg8bjUd+TrPIlLoGaH1U qmcUMmOAC3RK1pdJpir0jpBkdxmaObSdBR1ryfq/ia3or63P/A65Z/UAs7kKzx1QJXLGAduHdQ6vS toXUCseXNNVksG5mxy03hNgzq0oDvULKRivwKlsjwoOzYIWNR2SM3k0EXTRe1SMul4fftHWU4HGGp pAHi35EYW0Jiap579cYJteERhN+bqEr2vLvoU/vmKkhFPxLVjUCnjjfaAzWxbeDCII1MS8JHAkz5+ GEsusc/eXwW+sa/3v87Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxgOg-00000004PTR-2Ajb; Fri, 19 Apr 2024 05:02:50 +0000 Received: from phobos.denx.de ([85.214.62.61]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxgOc-00000004PRm-3xYx for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2024 05:02:49 +0000 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_Kleine-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 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240418_220247_372782_D0D34A76 X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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);