From nobody Sun Dec 28 04:39:26 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6B30C4167B for ; Tue, 12 Dec 2023 21:46:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377344AbjLLVqS (ORCPT ); Tue, 12 Dec 2023 16:46:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377559AbjLLVqR (ORCPT ); Tue, 12 Dec 2023 16:46:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6BDB0 for ; Tue, 12 Dec 2023 13:46:23 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22AEDC433C9; Tue, 12 Dec 2023 21:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702417582; bh=uKOZ4tqE+zOqk+xylv9VfF6p9YlzZn6ohPRKk8Y2X50=; h=From:To:Cc:Subject:Date:From; b=JGxQ0xXv10OO7D5bOuEt6d/1gKRvFb7jeN2cajBxU+GNhXY7Ik3e+2WqrBLzlg430 D9pNgRhJEweZ+LRIVWO5JoXhFSOGLj7ERi8MUrW9YTUP2wGvclr+9UZzZcHzk+YUa+ /h+p4GhYCYko0P/oV8aM3DloACuaBM1yOvjO6l/CjcVp//Mgn90m0jFTPRxhmp4GOu 1KDmB9KOiQOihznxc4uNB/ug8cy/SSnzTmhtcmafjZZL7JEmE5xxponkaqaFgIbJTh TGf9qACj9UB/RluCdNyeyBr8RSpx7BU1jA5kpekyKW7737ONE07ZTIOtLaorGUFPKD TAncofhG+FFSQ== From: Arnd Bergmann To: Daniel Lezcano , Thomas Gleixner , Linus Walleij , Nikita Shubin Cc: Arnd Bergmann , Alexander Sverdlin , linux-kernel@vger.kernel.org Subject: [PATCH] clocksource: ep93xx: fix error handling during probe Date: Tue, 12 Dec 2023 22:46:07 +0100 Message-Id: <20231212214616.193098-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann When the interrupt property fails to be parsed, ep93xx_timer_of_init() return code ends up uninitialized: drivers/clocksource/timer-ep93xx.c:160:6: error: variable 'ret' is used uni= nitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitializ= ed] if (irq < 0) { ^~~~~~~ drivers/clocksource/timer-ep93xx.c:188:9: note: uninitialized use occurs he= re return ret; ^~~ drivers/clocksource/timer-ep93xx.c:160:2: note: remove the 'if' if its cond= ition is always false if (irq < 0) { ^~~~~~~~~~~~~~ Simplify this portion to use the normal construct of just checking whether a valid interrupt was returned. Note that irq_of_parse_and_map() never returns a negative value and no other callers check for that either. Fixes: c28ca80ba3b5 ("clocksource: ep93xx: Add driver for Cirrus Logic EP93= xx") Signed-off-by: Arnd Bergmann --- drivers/clocksource/timer-ep93xx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/timer-ep93xx.c b/drivers/clocksource/timer= -ep93xx.c index bc0ca6e12334..6981ff3ac8a9 100644 --- a/drivers/clocksource/timer-ep93xx.c +++ b/drivers/clocksource/timer-ep93xx.c @@ -155,9 +155,8 @@ static int __init ep93xx_timer_of_init(struct device_no= de *np) ep93xx_tcu =3D tcu; =20 irq =3D irq_of_parse_and_map(np, 0); - if (irq =3D=3D 0) - irq =3D -EINVAL; - if (irq < 0) { + if (!irq) { + ret =3D -EINVAL; pr_err("EP93XX Timer Can't parse IRQ %d", irq); goto out_free; } --=20 2.39.2