Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp70360lqb; Thu, 23 May 2024 11:02:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVuwZCDRlvD+7PlRYgopHhk4CkMS9kck8UvLUqw4ELqLJXZ40fPgPIRkkbyppiwYJmQ2DfGEv/y0LakIrg/Tfk3Y0bg66V+fRJNi6RhKA== X-Google-Smtp-Source: AGHT+IHCMhMrUNgQxcAqkvLhRfeBwF/sb7zhyccAcQpk32qfXIFdNvjam0sPADhB8sAfdYc6kBhi X-Received: by 2002:a05:6a00:4b53:b0:6f3:eaa2:53a0 with SMTP id d2e1a72fcca58-6f6d61686f6mr6542406b3a.24.1716487324134; Thu, 23 May 2024 11:02:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716487324; cv=pass; d=google.com; s=arc-20160816; b=ctKhHXr2sjYkjMSWmEbZNtbMR/Fp4aPPUueE5q4aHtInHarmUeZJez9W1YiX8oUzRC o1layMkftw4IHbkqlXq3GoTooiNUsY10PVYZHUpJHpe+U+obbjD6bLwcC6d53R4zIObr A0VcuSLH/lsmP4GlIwTAe6Xk0ZMAP8Z5KGZOExekWhEplQ//qeNkq1r2ZAenpDrocQYb 0bteDC5WWOKfK8VnJYrMKOOFUD1TiHmU/rEOY27iaFLL/0A6CTGeu6aqsNLLx8SDdsWs /a04QeGIZdua6RtTuZVgqsI5sR8rchTNdpeA6+KtfOM6Ud2PVA44dgLMJjwGDOgABT85 2LQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=hAmXocRkIx1PH2lT0cYBRu4GpiG/zqum3FJI9WN36SY=; fh=Wva2sLo7IJylflYgRkVO9vUtff9ZMNLIBPjlnvldACM=; b=hwJWEVgiBNqBN2pgFYWJyopUu8o3ijWYw026GGcgrguRbokBs8WBRFlqPUvLbBPOSY mafGQixejx54+WQN6ByPDh4JFbG86lu3K1i8jbaQVENZgFGvJUYpDcyCWzWqm2Mi+JMr nrUiW3vs3ZDYz8eDvr/uK1U0Grdh2pcNbc6IaEWGpHeAb5JAFNlt3N3gOuXXSqZZPfch oCoOX5+Enf/YcUZYspx4dk1+CooInSE+JxxeL18R31fUQ/nsiTdPc2ivWd+1yiCv3hT7 WY0VzFaWSq5isL3NSjZjZWzh071qnuqR7Uq6tlqI2pp0wLtZwzu3erus1eez7nhU5sVS nyUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mzr55e51; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-187851-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e825a1si2557648a12.99.2024.05.23.11.02.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 11:02:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187851-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mzr55e51; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-187851-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EC97828165D for ; Thu, 23 May 2024 18:02:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F01807E572; Thu, 23 May 2024 18:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mzr55e51" Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FCDBF9F5 for ; Thu, 23 May 2024 18:01:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716487317; cv=none; b=eIOiN//cndR8r7WLp1jLZTFYZm7/VuKnuga8A+vaGZ4K9uzEFyTp0vi0UlX4CwlMchrHZTUillLozstN2EdYCAUQmOikISqkv0xCmx4W9iQ3Q0EcNc4oJjYO6R/zs8hCnJRZgJtUh47io2VGAgLCnKOqFfzIeY0/TpS7VWd4YHk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716487317; c=relaxed/simple; bh=Mkyvi+hwGqf0BwdJmb5ZcX25h3S6XKbnnfWJg5dvTVI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=c8jLBFagj4caRw5/u01ZgiROzkFbMBQNHstq2MiVRzqFA1OOkxDLvOZqSY6CgD3HeoOPIHqJTDrwpUBgYgrIRw/fyhvOCLpKY+HD5WxyJZJKidqgLge2QPxR+cWYVy7N+3l5RQrfdqovbZilRnsFJsOMMmEemslWpaEfymlEj+c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mzr55e51; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5785109cd7aso92864a12.0 for ; Thu, 23 May 2024 11:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716487313; x=1717092113; 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=hAmXocRkIx1PH2lT0cYBRu4GpiG/zqum3FJI9WN36SY=; b=mzr55e51E1CQGLp0yOw/2IHd7cdnjAmJFZTN9QWh1i2MQpLRNRcwYD4dljhehCNhrR 5tlM2StD92cViLROjHv+g7RwK9xGe/Bgb60av8HExGxvEjQFewt+/WG7SaKirdi81v8t TIz93GgPr1/V5NP4PhegpSYhL2nhcytC8Qqc+idl11/MJszgsyfAL9xmVaL3Tkww4vb5 CBT3Az2czKQo2F4m5TJYfzRFWCUO1RDEEDRRNrkHFREHY4mrSlx7s2rqLHceiZgFUqgR NaXLRUwg78VnoY/nyzZwsUzyzKTbK4rjbm/R6nNCrjl19/Wq9nRewzaAEtvcUhz2AGGq 3ACQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716487313; x=1717092113; 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=hAmXocRkIx1PH2lT0cYBRu4GpiG/zqum3FJI9WN36SY=; b=KbNupBOHpDlmsy3sKj8paYkc04PU5/EEgh82MCO962Z7xK+o4MkxDXXvGSULI1Y0dI rc7ceemr1DMjJV5HVWdtxSvau2nDNNJrS95RcP/FS0zqiZV/Nk4HWDOmIWMZQv7wozGj IhWCf1Ae/u400WRlm7VWpTl9rmIxsRUcPJP8bUCowBqlAVayZEK8UzylYwDfPcDDT478 kagcDMpZUi1x7//W/xU88PQuCa2rLnu4JS6/7GrCQyFkWrsEATxIsWQjp4YuYFk2A3iz Z5kB1qy/BRnR4rV6btGwQxdAS3JkhwSUbV/lWFLWgXxOlD8RKZO6MhfKVRNWJeMcv3B/ uueQ== X-Forwarded-Encrypted: i=1; AJvYcCUzEnYEUgAVtxmqjEKT0bXIi86MPILQ69eslgmWEdX41po6VctcfV/wdIeB913lPhlyVCA2PHeP756AazQhXUnfJPXIgg3nzw+5lGEx X-Gm-Message-State: AOJu0YzH/RZdeb5hk9syMWwmH79bvtSu8EFxYulLqcYwlbkfhPdEmB6o hLcWWR1LVnVim8Zxs5oOznEvlER9hNMvWtbZv6RKvQGuBhF2fr3b99H6eq9emh2/MqOvbILZVHT 5g0eiL7SAB75QaHbkuQzaXL+Xoto= X-Received: by 2002:a50:ccc2:0:b0:573:1ebd:d670 with SMTP id 4fb4d7f45d1cf-5785190fc49mr28765a12.3.1716487313413; Thu, 23 May 2024 11:01:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240522194250.1165568-1-pvkumar5749404@gmail.com> <87h6eo3h4i.fsf@mail.lhotse> In-Reply-To: <87h6eo3h4i.fsf@mail.lhotse> From: prabhav kumar Date: Thu, 23 May 2024 23:31:40 +0530 Message-ID: Subject: Re: [PATCH next] arch: powerpc: platforms: Remove unnecessary call to of_node_get To: Michael Ellerman Cc: akpm@linux-foundation.org, npiggin@gmail.com, christophe.leroy@csgroup.eu, naveen.n.rao@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, julia.lawall@inria.fr, javier.carrasco.cruz@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 23, 2024 at 4:55=E2=80=AFPM Michael Ellerman wrote: > > Prabhav Kumar Vaish writes: > > `dev->of_node` has a pointer to device node, of_node_get call seems > > unnecessary. > > Sorry but it is necessary. > > > Signed-off-by: Prabhav Kumar Vaish > > --- > > arch/powerpc/platforms/cell/iommu.c | 9 +++------ > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platfor= ms/cell/iommu.c > > index 4cd9c0de22c2..5b794ce08689 100644 > > --- a/arch/powerpc/platforms/cell/iommu.c > > +++ b/arch/powerpc/platforms/cell/iommu.c > > @@ -780,14 +780,13 @@ static int __init cell_iommu_init_disabled(void) > > static u64 cell_iommu_get_fixed_address(struct device *dev) > > { > > u64 cpu_addr, size, best_size, dev_addr =3D OF_BAD_ADDR; > > - struct device_node *np; > > + struct device_node *np =3D dev->of_node; > > const u32 *ranges =3D NULL; > > int i, len, best, naddr, nsize, pna, range_size; > > > > /* We can be called for platform devices that have no of_node */ > > - np =3D of_node_get(dev->of_node); > > if (!np) > > - goto out; > > + return dev_addr; > > > > while (1) { > > naddr =3D of_n_addr_cells(np); > > nsize =3D of_n_size_cells(np); > np =3D of_get_next_parent(np); > if (!np) > break; > > of_get_next_parent() drops the reference of the node passed to it (np). > > So if you actually tested your patch you should see a recount underflow. > Thanks, I will check this out once again Prabhav > cheers