Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2817501pxb; Mon, 19 Apr 2021 15:01:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8AjOLNVEF3Pf/VXwCM6QHSFk+JB3d/LlHalzWd2ieoiChT2IAddjUR+jspyk1k2qW3/gj X-Received: by 2002:a17:902:104:b029:ec:9fa6:c08 with SMTP id 4-20020a1709020104b02900ec9fa60c08mr9351670plb.10.1618869663309; Mon, 19 Apr 2021 15:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618869663; cv=none; d=google.com; s=arc-20160816; b=sHhGlwn2w/wyIoDLOTHaPyBt/v5DCTylfMGyWo2+ubaMoNm8cn6BnGmIL9FT2zcKHy CukFPVAkgS/4vRNxg8oZX5mzO39XFXJNa+X4hqkETVh2h5LBq9kaJTXBHT4MPstp5fTb QtX3cBK151+oo5IOl18nS7JjevDvznfDgJKAHwEphCRfl3yHDSJdRk8TMHpyTbABFhR3 v+d6nfBuPH0lyjX07JxGPHprTBRLCbJnT8jESmsAjyBL9y5z/B/BaoUc7zZHYgtN3lct ycR/t/QMzT/a0fFVgdTfdcBGr3MQ1GIu4ni9JRZ29oPY8g+5cd30SDCkP4OQ1zy11MSf JVXA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=80lTGXfFTieB6ZejHrAbrvThx7kA+sg96j9v+YuU4dg=; b=f2CncUCN4OLkMr0GX3sBjqWIf/dvVucLBcFA0r0fyYkxZNwGgEkErA9eJ64MVMVKEK xqu0tS/JmRqEOdAkH0jGfV0Ty38r007AiSA3B2KoNGkrj2ITO5JVrtpREy1QvFlH/LxC DLt85/AAL0cIwqptS+zf1aPvkT8R09yGhn/ZPOnBkSjWdazMm2gRBsPkJjdJXfoiGiH+ JOV7iKfq3bXtW56/Qnj6fd8E1LSiSj79uN9GycqrlBH8WwYyh5C+hodiPR0fix459slK 1ugniKvSA7oUO/cZ2vSgOfKemSCKndC8YkEKUXEEfBlA73Vm6WxSd9nj041lH7ZuGo35 FZvg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si834297pjg.35.2021.04.19.15.00.50; Mon, 19 Apr 2021 15:01:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231481AbhDSWAc (ORCPT + 99 others); Mon, 19 Apr 2021 18:00:32 -0400 Received: from smtprelay0203.hostedemail.com ([216.40.44.203]:34804 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229558AbhDSWAc (ORCPT ); Mon, 19 Apr 2021 18:00:32 -0400 Received: from omf07.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id BE8CB100E7B45; Mon, 19 Apr 2021 22:00:01 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA id 49D5A315D7B; Mon, 19 Apr 2021 22:00:00 +0000 (UTC) Message-ID: <84e443d76c4c450770ade83aa48cc631c101d383.camel@perches.com> Subject: Re: [PATCH v2] iommu/amd: Fix extended features logging From: Joe Perches To: Alexander Monakov Cc: linux-kernel@vger.kernel.org, Paul Menzel , Joerg Roedel , Suravee Suthikulpanit , iommu@lists.linux-foundation.org Date: Mon, 19 Apr 2021 14:59:59 -0700 In-Reply-To: References: <20210411211330.2252-1-amonakov@ispras.ru> <0362ad3912473d24e5927c0b54ed8fd3648c68a9.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.10 X-Rspamd-Server: rspamout02 X-Stat-Signature: rr8wy3tt7e6ewhrtb5agpwuwwj5up86q X-Rspamd-Queue-Id: 49D5A315D7B X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18mE84hj7FKvZFlpJsPAFtqDoE9xBfErBo= X-HE-Tag: 1618869600-770237 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-04-19 at 22:23 +0300, Alexander Monakov wrote: > On Sun, 11 Apr 2021, Joe Perches wrote: > > > > v2: avoid pr_info(""), change pci_info() to pr_info() for a nicer > > > solution > > > > > > ?drivers/iommu/amd/init.c | 4 ++-- > > > ?1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c > > > index 596d0c413473..62913f82a21f 100644 > > > --- a/drivers/iommu/amd/init.c > > > +++ b/drivers/iommu/amd/init.c > > > @@ -1929,8 +1929,8 @@ static void print_iommu_info(void) > > > ? pci_info(pdev, "Found IOMMU cap 0x%hx\n", iommu->cap_ptr); > > > ? > > > > > > ? if (iommu->cap & (1 << IOMMU_CAP_EFR)) { > > > - pci_info(pdev, "Extended features (%#llx):", > > > - iommu->features); > > > + pr_info("Extended features (%#llx):", iommu->features); > > > + > > > ? for (i = 0; i < ARRAY_SIZE(feat_str); ++i) { > > > ? if (iommu_feature(iommu, (1ULL << i))) > > > ? pr_cont(" %s", feat_str[i]); > > > > How about avoiding all of this by using a temporary buffer > > and a single pci_info. > > I think it is mostly up to the maintainers, but from my perspective, it's not > good to conflate such a simple bugfix with the substantial rewrite you are > proposing (which also increases code complexity). You and I have _significant_ differences in the definition of substantial. Buffering the output is the preferred code style in preference to pr_cont. Do remember pr_cont should _only_ be used when absolutely necessary as interleaving of other messages from other processes/threads can and does occur.