From patchwork Wed Oct 2 17:50:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13820185 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 88708CEACF3 for ; Wed, 2 Oct 2024 17:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Cc:To:From:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9+tbIUnTt4a/8am5hF5w0MAc7rkV/fOrFs8cjHSvbYI=; b=wndZdG56a70+Ct1spNT+RGmdFY yJScN2qODHi2Vk32SDtvd4mHbDXN9cBlEDel0p6Yxz2ehD0i5yKvuJXiNN+pW4gYlAl5xJRBhZNRt kmxzlf7BjeixDucLTqsRXw2Sf3BMpu9I8cvNNMa00XTyncbVKLRfxtN0JZ+cfcWTyjQcLa9YCOS5k /2MIl1Pec59pSkGUNj9THXz1/K557HgWpM97Y1gexLKM6r8LXAV01zUJdZldKTljUeXsTdsgq6BfF QwVcxxgVTtcSxEvYbxZztPm9msN+Mctkc5BvGQhMEYKwqwsBZE4+Xr69OVzGhjNwntALA+6zu5kXq NXq6lfkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sw3VY-0000000766i-1RMM; Wed, 02 Oct 2024 17:51:28 +0000 Received: from mout.web.de ([212.227.15.3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sw3UH-000000075tS-3lfH for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2024 17:50:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1727891404; x=1728496204; i=markus.elfring@web.de; bh=9+tbIUnTt4a/8am5hF5w0MAc7rkV/fOrFs8cjHSvbYI=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:From:To: Cc:References:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=u/iYR7hMMebxvoYwiF1L95igZc507p5BErhiYs2j8q7Bq/tep83NiNhZjhBE2Dy4 klTxiSQBkFB8wQRVZXCrblDcHMuiZneC1O+dlCPtQpftaG16eE8tOUOdMz2W+5uvx q3vEr3DuejOcLL0oX1Ilk4O9sA5M73xHv3zXZHSEGzkz0/AnXQgeEE1VTgDvJOGAY EgJBp4lnCTKVyrDJCT4qIBj1gmncFdps6YJ965SYKHvd3RdBqY/SgJeivwoSIpQsE VeDiNr5JNxY4rn9lFcmQTFg3/40h5aGjA2eQFe1OoCY/zQYFNge1q1G9XlYcXfXqk wBv5vagR1Tl5CrjLPw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.81.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N9cLR-1rqf4D11Wv-014yJT; Wed, 02 Oct 2024 19:50:04 +0200 Message-ID: Date: Wed, 2 Oct 2024 19:50:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 1/2] ARM: mvebu: Call of_node_put(cpu_config_np) only once in armada_370_coherency_init() From: Markus Elfring To: linux-arm-kernel@lists.infradead.org, Andrew Lunn , Gregory Clement , Russell King , Sebastian Hesselbarth , Thomas Petazzoni Cc: LKML , kernel-janitors@vger.kernel.org, Krzysztof Kozlowski References: Content-Language: en-GB In-Reply-To: X-Provags-ID: V03:K1:m5vIIPSZoADKCbGY2A8GWNnm1j2VylPZVBy3RyMdeOdMcdDjJLo usJ4gCliqMBVSJ/JPUjtozGDs6qBWhn3NTAPzgwAi7Uv/oIVw9RDauKt+TMq2lDYjpnW82G WRpMn8f6wEeN+UVsGbzIv0Wohn74Dn23Z6JRAWpQCxdptvEQDykIRJuA3LiJ8wo2DrF503z xMOVwsRMUFzdCFLO1R79Q== UI-OutboundReport: notjunk:1;M01:P0:8v19PMwUCp4=;GH3azTOGEsKURqrbj1flHC8B34l ljxGUGDp5l4Cr97RI8oTtEsN0Wcvq9NGlvpzLtQco6aBMSuLJVcYyZtPeev9HiAoyMbENBbq+ cqV5b/PWPZ7zgrjTv/zA9RDQybBi3+Cn8bi09mDuOo6J0FPcaIEEDHcM+u0JvW7oZZF/FTrL5 +XJWnOYADaHeBFj8IQbDYEZBNEmmYJzl541mGFSaElJZy3twyt/dQ5Oaf7gJ7+CqMerUZbdkI CvLFYrqu4Fl4+4fd7qJx27D2T6DENjbw8E+1URtpCvoIahu1jVzI9IENuLmDcYyMT2Gaa1U7F fIEGQRHjmgiDZpaP9DNctsFivV/zydVSlO0WECTS4ySQAKpc8ORZpsZCW40lGa/A6cita63/N yCbqCS7g6b1y9wm4smU45HK23x5sMqqfqLMY0S1q6GE2/BfuSnjo0kEZuo1Yj9GAaFunVw7Co VWuXAMYu+H4K9Yh2nJzz7JH9riNCdsiU3lSJVcmTr6PMCJwEgnjlc5z1slmEr5BBb7wkjYLul 4DgQpJHYTRIlaI/q9ZpZPKGxT5PhVRy0uemaZpLZqVnWXRTLAkVZ2Yz4Li7kxH3D1CBwZ8QOX cjMNtf6Bpmb+A/EeP1H8SyjUYjbRHU6+hmuH4wy4241mzfowVv/2zIL/860H43PG7L0mygjME 8MHfcjyh8v4+8r9v4+jP2qxKtBdzy9q2MAsAEgUb59WNlCmPuxfu4v6IFvcnq/74l51S9TvDJ E+/+Vt2/pD6KgFfBFxespkZnx2t2AArT98lNLmj21CUMT5BSdLoZzcOU+pmRqThYzNcUo5WFj MaPekFFEjqkd7NGLtVdYZ02w== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_105010_261203_04F1DFF2 X-CRM114-Status: GOOD ( 10.01 ) 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 From: Markus Elfring Date: Wed, 2 Oct 2024 19:02:28 +0200 An of_node_put(cpu_config_np) call was immediately used after a null pointer check for an of_iomap() call in this function implementation. Thus call such a function only once instead directly before the check. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/arm/mach-mvebu/coherency.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.46.1 diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index a6b621ff0b87..262410ccc4bd 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c @@ -137,12 +137,9 @@ static void __init armada_370_coherency_init(struct device_node *np) goto exit; cpu_config_base = of_iomap(cpu_config_np, 0); - if (!cpu_config_base) { - of_node_put(cpu_config_np); - goto exit; - } - of_node_put(cpu_config_np); + if (!cpu_config_base) + goto exit; cpuhp_setup_state_nocalls(CPUHP_AP_ARM_MVEBU_COHERENCY, "arm/mvebu/coherency:starting",