Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4936131rdb; Tue, 12 Dec 2023 13:46:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKJefy9GJ9MsXXTk9XzjyClrv60YWWjERpqNQu9sYW0QbCvOkZWc17rIbcojIRpHxWlJ5I X-Received: by 2002:a05:6e02:b4a:b0:35d:6508:5e39 with SMTP id f10-20020a056e020b4a00b0035d65085e39mr10391956ilu.4.1702417598503; Tue, 12 Dec 2023 13:46:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702417598; cv=none; d=google.com; s=arc-20160816; b=P+Lh518IkC8Sbu9c7MRKJo+kUBb782AgcA/kFYSXOS9WlonBDqOBDzoJWldJRbAhrZ /LShyHqXdxEGuKHE8d2Q50XCkNRQM9Mn2HqlwgNn/Ql4VZpQpmvGA1+pGk3eNdxG0i7B TIZAfGK8iruAMgVvVmSGMVXgpxSZm6005YJyLCy5gReR58b4L85wZn5lnSsZpYRsdfWq u0LBvq2rUiFsp5/UWn4y0Thb5yigQDgL84CY2f0+ayGhARikIa03yP7nTPwO0dQNU4Bf 90EIWMqqAc2GqLSviDnDqYp/xCpMz+Hds3oIM3UpFkrdKm79ISEFdOQaz/V8+yUOFB/J uHQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2YUwnZuongvf3xrDDrOeCdffuqcxw5anOcfduTzAfKQ=; fh=sII4UDGpJcHCpI9faz6Zs2dDZRSZGENjpAVKX3j7haU=; b=l5VyD7rnhQRMlmvDxMHvz+1IMBJH4ewMhP4EPr/90EuLUB2PozSx6An7ZPYI2CTa29 saTnvw9jjYY2kYxwc9b3YhVKTZmzyGa6kGKcUDK3FjX/pPLWU2B3Iem2NNngn0As5Vyt FVi+89GsVwtbOYLWcwiUAeDxL+K8c92DUiV9/7JyEJRH5LArhLV5/Yn4vyTjh0Dcsd1T vxuDyr+cM9w6meXMuY1YueBTCbizrLNbcm+MO98+SJ0p8DjVLlKZ9yVgfFF4qAGmJ7Kv uCxdAN1u6zU/6vtWMRvPRxe3o4bWjFzGE3zJrpdAAnciGTzzLPAkSH+gSZm82xuR/p3o 4a+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JGxQ0xXv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b30-20020a631b5e000000b005bdc49ba91bsi7966566pgm.151.2023.12.12.13.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 13:46:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JGxQ0xXv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 21F91809A781; Tue, 12 Dec 2023 13:46:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377571AbjLLVqS (ORCPT + 99 others); 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: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 13:46:36 -0800 (PST) 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 uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (irq < 0) { ^~~~~~~ drivers/clocksource/timer-ep93xx.c:188:9: note: uninitialized use occurs here return ret; ^~~ drivers/clocksource/timer-ep93xx.c:160:2: note: remove the 'if' if its condition 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 EP93xx") 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_node *np) ep93xx_tcu = tcu; irq = irq_of_parse_and_map(np, 0); - if (irq == 0) - irq = -EINVAL; - if (irq < 0) { + if (!irq) { + ret = -EINVAL; pr_err("EP93XX Timer Can't parse IRQ %d", irq); goto out_free; } -- 2.39.2