From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752751AbdLGUTp (ORCPT ); Thu, 7 Dec 2017 15:19:45 -0500 Received: from mga05.intel.com ([192.55.52.43]:15540 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbdLGUTo (ORCPT ); Thu, 7 Dec 2017 15:19:44 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,374,1508828400"; d="scan'208";a="727180" From: "Mehta, Sohil" To: "joro@8bytes.org" , "alex.williamson@redhat.com" , "baolu.lu@linux.intel.com" CC: "Yu, Fenghua" , "Shankar, Ravi V" , "linux-kernel@vger.kernel.org" , "Kammela, Gayatri" , "iommu@lists.linux-foundation.org" , "dwmw2@infradead.org" , "Shevchenko, Andriy" Subject: Re: [PATCH v3 2/6] iommu/vt-d: Add Intel IOMMU debugfs to show context internals Thread-Topic: [PATCH v3 2/6] iommu/vt-d: Add Intel IOMMU debugfs to show context internals Thread-Index: AQHTbkRjcaPb2F0o/0Wv8AU5+t1WG6M2focAgAJclwA= Date: Thu, 7 Dec 2017 20:19:42 +0000 Message-ID: <1512678006.120652.17.camel@intel.com> References: <1512531807-24268-1-git-send-email-sohil.mehta@intel.com> <1512531807-24268-3-git-send-email-sohil.mehta@intel.com> <5A27A74C.9070201@linux.intel.com> In-Reply-To: <5A27A74C.9070201@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.25.110.4] Content-Type: text/plain; charset="utf-8" Content-ID: <6789F6564A7EF942B9F2480A49147EC7@intel.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vB7KJn85001033 On Wed, 2017-12-06 at 16:16 +0800, Lu Baolu wrote: > Hi, > > On 12/06/2017 11:43 AM, Sohil Mehta wrote: > > > > From: Gayatri Kammela > > > >  > > + seq_printf(m, "%s Context table entries for Bus: %d\n", > > +    ext ? "Lower" : "", bus); > > + seq_printf(m, "[entry]\tDID :B :D .F\tLow\t\tHigh\n"); > WARNING: Prefer seq_puts to seq_printf > #119: FILE: drivers/iommu/intel-iommu-debug.c:59: > +    seq_printf(m, "[entry]\tDID :B :D .F\tLow\t\tHigh\n"); > > (caught by checkpatch.pl) > Hi Lu, We'll fix this and the other checkpatch.pl warnings. > > + > > +static void root_tbl_entry_show(struct seq_file *m, void *unused, > Why do you define the "unused" parameter which will never been used? > The same questions to other show functions. > Some functions in our code that are registered with seq_file needed to have an unused parameter since seq_file.h defines the show function as: int (*show) (struct seq_file *m, void *v); But a lot of other functions including the one you pointed don't need to have the unused parameter. We'll remove it from those. > > +void __init intel_iommu_debugfs_init(void) > > +{ > > + struct dentry *iommu_debug_root; > > + > > + iommu_debug_root = debugfs_create_dir("intel_iommu", > > NULL); > > + > > + if (!iommu_debug_root) { > > + pr_err("can't create debugfs dir\n"); > I don't think we need a pr_err() here. System works well even > debugfs_create_dir() returns NULL. > > This is same to all pr_err() in this file. > Would the recommendation be to use pr_warn instead of pr_err or should we entirely skip the message altogether? Thanks, Sohil