Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4062064rdb; Thu, 14 Sep 2023 10:32:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHM0E1ApJrvtRY6SEFpaqspQVyilGtWdpwUaYtiQumi1pFIhCLMhoLWMBW6rFxrVJQAm77 X-Received: by 2002:a17:90a:bb86:b0:274:9409:bbca with SMTP id v6-20020a17090abb8600b002749409bbcamr166980pjr.3.1694712737550; Thu, 14 Sep 2023 10:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694712737; cv=none; d=google.com; s=arc-20160816; b=U9PRGBEG+RqI+vGTRIkBpVn99tEuWID57hdZYwEfvszOlU/+j02HIaLspTs5kmNdKL pH964LwEtWKdYELuX1uwzN3ouCT4bq1T1OgUCe9yEkc0iZmKlZXsnGmVwd1UsDH91EOz dextP/i0EHSHhuTUXPSpxTKt6e/JSF4O/lJodNgp180rJK3Caq4V05TZHravWdlvtD6O erTCzWxHkI8J1jFNjSaoGgHWNw6teVSPMEjLNkV6UD4ATFALJUtKAeuLLapmPcv91UrQ 7XLtkpuPlSAyWDMan/RvbrqdL7hTscymD35fLudTlT2qKK+fzHNht9zP5OHjnHhlQANd quVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=F+rU7wcT/qbiZt6TYqHVxXtgFSA+h60mY5w5mpZqjdw=; fh=vKRgsrrIrbTHnNcaJ0MMZvNS/V2hsYwZdpkU7awJz0M=; b=Ny/96PJ0owZC3C1q+ru46td4VbrYcIR7d+dDpEt5Nji603wWkOv+kE9gMklw6UCUVM uRiXIMQHDZZ1t9MGJ7pzHkKl6kZDCdKqwSisz4HjIeBHgCdwQczuTUw0vDxoZAkvJbDf x8dDEyU10Xm/vA3zN0n4l6IKgNTF7XTGY32L8/P0fxiK2S98yjvauZgZftOVqkem4Y4t +6kEMId2cE1wHDA9v13ipQIGsL8YOVidHoxyh5vqc7rVBDxwsL9mUHwHM6TGPN/OJrA+ ZjLiHbqfhKrmnsZPGWdyLyi0ukmiuonV66w+keH0/Gw7Hxrkr2FiENjXjGA11o/KSrVj /doQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=efxBzJTz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ca5-20020a17090af30500b0026f512692fdsi4102634pjb.91.2023.09.14.10.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 10:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=efxBzJTz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 42B8381A7D1A; Thu, 14 Sep 2023 06:58:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239390AbjINN6R (ORCPT + 99 others); Thu, 14 Sep 2023 09:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239273AbjINN6Q (ORCPT ); Thu, 14 Sep 2023 09:58:16 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8D831BE3 for ; Thu, 14 Sep 2023 06:58:11 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id 3f1490d57ef6-d8198ca891fso580456276.1 for ; Thu, 14 Sep 2023 06:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694699891; x=1695304691; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=F+rU7wcT/qbiZt6TYqHVxXtgFSA+h60mY5w5mpZqjdw=; b=efxBzJTzTHReFf2hKOtVfFVuLgEMAx1SixQkry70nJAoN9O/AURxcSuC0RCtvIerWe TRT9lL3/YvKPNnivkuAr/lg1HsK+1A3tlQUKCo80eJsI7uzlBQxyd1h6x9Bky5Lx38eN Z8WMUUV2LMWtujwhce/QqnBrHcoNmiITLO3duRVmMhC+DhfbW6JATkVMM4Y9cPpclw2Z WcE+2L+0SvMLOpVhN48D5sxAT93bYNUu+M+NjX6kOEiBTY9dSVRsP8m96Sz4jUGDrHq1 +G2ITtyJbhL5gHABRKeR+epN386hAdf+YB/f6kRNuVkYYI0DfYaIDNJyhYS0ltuig0eJ 4XPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694699891; x=1695304691; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F+rU7wcT/qbiZt6TYqHVxXtgFSA+h60mY5w5mpZqjdw=; b=ur/2Rub9nr2xOtRrdxcw0CmSEOsv9T4C8++ZsLwgBJPC0P7TkmfvYxbfjNDtBFHkup ibPzl6yl6HmNooAfg6QM0be5qQMYJq3aUoztUUWaeieb2oQoBX+CN+4emArbgq+ba6+x haECE2XUYb2oqqN7eXODTT+vUOxFvAW7xN6S1kG38hFywBN9QJp53bFHxxd9aRntyRg7 Q7gElG97tdmjt2C0t+xaz63RXCbhqsJ6tffxFfh4qtonxPaLP/FecsNdWB6f8E0UWXqx ovR6XsnCSGjRZ9w9EguGFC5f9fIu3TAkYAj0kPi2ioob59P6xWOnff736+u2iBabOAk4 bLrw== X-Gm-Message-State: AOJu0YxBBhRhIERUXxIhD0mWjGlwVjPcCczQnn8RKsZfFgBZR/g2NSBf ERgdjRH9E/TecFDeWz24NOStirMNPGjh3DPWKqV83Q== X-Received: by 2002:a25:2044:0:b0:d7b:9d44:7574 with SMTP id g65-20020a252044000000b00d7b9d447574mr5730857ybg.64.1694699891168; Thu, 14 Sep 2023 06:58:11 -0700 (PDT) MIME-Version: 1.0 References: <20220615090517.3961621-1-windhl@126.com> In-Reply-To: From: Linus Walleij Date: Thu, 14 Sep 2023 15:57:58 +0200 Message-ID: Subject: Re: [PATCH] arch: arm: mach-versatile: Add missing of_node_put in integrator.c To: Rob Herring Cc: heliang , linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 (pete.vger.email [0.0.0.0]); Thu, 14 Sep 2023 06:58:34 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email On Wed, Sep 13, 2023 at 3:01=E2=80=AFPM Rob Herring wrote= : > On Wed, Jun 15, 2022 at 4:06=E2=80=AFAM heliang wrote: > > > > In cm_init(), of_find_matching_node() will return a node pointer with > > refcount incremented. We should use of_node_put() when the pointer is > > not used anymore. > > > > Signed-off-by: heliang > > --- > > arch/arm/mach-versatile/integrator.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm/mach-versatile/integrator.c b/arch/arm/mach-versa= tile/integrator.c > > index fdf9c4db08a7..fba19357171a 100644 > > --- a/arch/arm/mach-versatile/integrator.c > > +++ b/arch/arm/mach-versatile/integrator.c > > @@ -76,6 +76,7 @@ void cm_init(void) > > return; > > } > > cm_base =3D of_iomap(cm, 0); > > + of_node_put(cm); > > Not really sure this is right. It is in the sense that the DT node is > never accessed again. However, the device itself is still accessed and > I tend to think a ref to the DT node should be held for that lifetime > which in this case is forever. Really, none of this matters because > nodes are never removed and these fixes are kind of pointless. I'm just gonna scrap all these of_node_put() patches these automated static analyzers have sent to the Versatile board and SoC code, it's too dangerous. > Note that cm_get() and cm_control() are never used and can be removed. > That would be the more useful clean-up. Yeah :/ Yours, Linus Walleij