Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1729105pxb; Thu, 7 Oct 2021 13:56:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWRFKbkxnHWLkBdIki/V0Zc+5d0QMEPxd+en79pSxhdnZ7gQmdTZa1N7rSFodbGJqDENHe X-Received: by 2002:a17:906:6c83:: with SMTP id s3mr8609181ejr.13.1633640205721; Thu, 07 Oct 2021 13:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633640205; cv=none; d=google.com; s=arc-20160816; b=lyxo7eBOh3VOI+POq0HUIrHJ3NfLDCJ1l2/XPSglsnaFAua3AaObLvURvSW8H5Lr39 58H/Qegn27733dotbW+KNophWZxaFjfY9FRcgBL65aA1jLwa64vKyJP8XlnrScsCiM5G eDbNKUsEc7vsp9Uud1hoWfqDPMH0f3pMRg3R1H2/wOB0M8x5m0LMIRhSc9VVEzhUI8XZ mBmG3lsh4FS8XJncXoSeW/MTiP8zdDNBSUqE68zQmp28tgQHXPebgRTYItpGnzQ5cNqF KExl1dM9f+H6WiLjLHD7LdaCoJJJLck6WXUs2kSxCGYz0Qt5uK37x+cG7i+a0vvzr7xf 4u2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/R6h2Xb41+ZaL3s6zRGcSwU7ER8EXS0p7pKvPqDNMfk=; b=ftyh944SwharrI6SDvy/UzXCjx3HI+VRyYhXPLCC68ryY/X7C4BYVvgH+Gf3ZHkvWs kOUwo1PoT8jVob95qpSJHvvZxcXkERn8bbI2hFUmd9FlNzbu4urzwto1GyHY0Eui5HIc 2RzGi9YO0w7f4VhRwcBKMJimk44cGXrif4OlY78mLeWJI0frv2oOlBv10TTgi0DPP65z R6sQuRGjafV/65hC1aE54c0bzKShaRDISqQpBdO04R0ApAvwYIxn4yUdOtO3FTEkDND6 tRyDe+jS9rUOaql1GkaoPiF7pJNp+9h5hW3BlvrzKtte6NerdGe23k7MW8JzHcRSlFs7 Pp6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L6g7yBOF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rk1si445075ejb.656.2021.10.07.13.56.22; Thu, 07 Oct 2021 13:56:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L6g7yBOF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234007AbhJGUjR (ORCPT + 99 others); Thu, 7 Oct 2021 16:39:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233223AbhJGUjO (ORCPT ); Thu, 7 Oct 2021 16:39:14 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A44ABC061570; Thu, 7 Oct 2021 13:37:20 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id c29so6341463pfp.2; Thu, 07 Oct 2021 13:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/R6h2Xb41+ZaL3s6zRGcSwU7ER8EXS0p7pKvPqDNMfk=; b=L6g7yBOFXxdPb9Sw7whNFWQtYTIW8g0VqYh6a43KbeHiW0W3tdpWnLy//caAJsFdas gZTblvWzCyBXOcFPMAY2u030GV2zbAWPtwLPC52ofNnui+8Ta9oaGW9G9oZUDgBJYM4r /zH3pDcHHiWAtFNfxQKjdueMGJsVVhrW7vh8oqYbmUgVqUmMzjSVG651It3EP4LCP8RI 3kJDljtbgyH+v+X4TNh7HlA394H9uFMMHOz8l8Z3ammocv/8Nj6LdZpXVh74TdTdargp CMgAHS9h1W0TNprmb16TRkVstAYWmuqEv5MIUc4AXzJyOiR3+GBcn5wb5HUtJ9vrzAM+ C4Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/R6h2Xb41+ZaL3s6zRGcSwU7ER8EXS0p7pKvPqDNMfk=; b=EqCoQxBilrUymuA24EaHOPUHoxzlqZysvsN1gwHTlRayDITzAolVwGAHH2WzzpJSd2 O0JnyStMIsJ6aNBGCF9jQQcf1KbYLRCSRSvQvOC/CXT6hDtjaoiWCUK168xWYyjwqbp1 qcoKzhO9RJVN1gnyngOi8fpU6XA2bDsw4SclPWhKfb1dQDmkWI/7PxAR9MQau1BIUyBL RbOanFAYHSxtaExAxAg0Jp4z5R2XKlPWI9ajgCanpE9yvl3xzqOwcXEzOSfcQTBbqTVO AH6XteS/SnArwgeWBRr/+mHUQb2g7JtjLT/90QfYPB2/f19A/Zn3yE1zw0S8Rg7WhKNM qU/w== X-Gm-Message-State: AOAM5325SsgoIU/v6DXRkpQsopHfW8tCUXmdQ/M2EDRbFz1s6BEmDbpQ fiof+d5loAVPJ+jp0QFDY80= X-Received: by 2002:a63:4b63:: with SMTP id k35mr1394325pgl.206.1633639038818; Thu, 07 Oct 2021 13:37:18 -0700 (PDT) Received: from Asurada-Nvidia (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id p2sm129926pja.51.2021.10.07.13.37.17 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Oct 2021 13:37:18 -0700 (PDT) Date: Thu, 7 Oct 2021 13:29:45 -0700 From: Nicolin Chen To: Thierry Reding Cc: joro@8bytes.org, will@kernel.org, vdumpa@nvidia.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, digetx@gmail.com Subject: Re: [PATCH v6 3/6] iommu/tegra-smmu: Rename struct tegra_smmu_swgroup *group to *swgrp Message-ID: <20211007202945.GB20821@Asurada-Nvidia> References: <20210914013858.31192-1-nicoleotsuka@gmail.com> <20210914013858.31192-4-nicoleotsuka@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 07, 2021 at 06:57:31PM +0200, Thierry Reding wrote: > On Mon, Sep 13, 2021 at 06:38:55PM -0700, Nicolin Chen wrote: > > There are both tegra_smmu_swgroup and tegra_smmu_group structs > > using "group" for their pointer instances. This gets confusing > > to read the driver sometimes. > > > > So this patch renames "group" of struct tegra_smmu_swgroup to > > "swgrp" as a cleanup. Also renames its "find" function. > > > > Note that we already have "swgroup" being used for an unsigned > > int type variable that is inside struct tegra_smmu_swgroup, so > > it's not able to use "swgroup" but only something like "swgrp". > > > > Signed-off-by: Nicolin Chen > > --- > > drivers/iommu/tegra-smmu.c | 34 +++++++++++++++++----------------- > > 1 file changed, 17 insertions(+), 17 deletions(-) > > > > diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c > > index a32ed347e25d..0f3883045ffa 100644 > > --- a/drivers/iommu/tegra-smmu.c > > +++ b/drivers/iommu/tegra-smmu.c > > @@ -334,35 +334,35 @@ static void tegra_smmu_domain_free(struct iommu_domain *domain) > > } > > > > static const struct tegra_smmu_swgroup * > > -tegra_smmu_find_swgroup(struct tegra_smmu *smmu, unsigned int swgroup) > > +tegra_smmu_find_swgrp(struct tegra_smmu *smmu, unsigned int swgroup) > > This makes things inconsistent now. The tegra_smmu_find_swgroup() name > indicates that we're looking for some "swgroup" entity within an "smmu" > object. The entity that we're looking for is a struct tegra_smmu_swgroup > so I think it makes sense to use that full name in the function name. This is more like an indirect change to keep consistency between function name and pointer name. > > { > > - const struct tegra_smmu_swgroup *group = NULL; > > + const struct tegra_smmu_swgroup *swgrp = NULL; > > I don't think the existing naming is confusing. The variable name > "group" is consistently used for tegra_smmu_swgroup structures and there > are no cases where we would confuse them with struct tegra_smmu_group > instances. If we don't rename it, then PATCH-4 adds to struct tegra_smmu_group a "struct tegra_smmu_swgroup *group", which results in a confusing group->group... > However, I don't feel strongly about it, so I'm fine with changing the > variable names to "swgrp" if you think that makes things less confusing. Yea, I'd like to keep this change. I will respin it in next version after fixing other comments.