From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbdKVVYS (ORCPT ); Wed, 22 Nov 2017 16:24:18 -0500 Received: from mga07.intel.com ([134.134.136.100]:35636 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584AbdKVVYQ (ORCPT ); Wed, 22 Nov 2017 16:24:16 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,438,1505804400"; d="scan'208";a="5334616" Message-ID: <1511385559.25007.415.camel@linux.intel.com> Subject: Re: [PATCH v2 4/6] iommu/vt-d: Add debugfs extension to show register contents From: Andy Shevchenko To: Sohil Mehta , Joerg Roedel , Alex Williamson Cc: David Woodhouse , Ashok Raj , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jacob Pan , Gayatri Kammela , Ravi V Shankar , Fenghua Yu Date: Wed, 22 Nov 2017 23:19:19 +0200 In-Reply-To: <1511378746-109275-5-git-send-email-sohil.mehta@intel.com> References: <1511378746-109275-1-git-send-email-sohil.mehta@intel.com> <1511378746-109275-5-git-send-email-sohil.mehta@intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-11-22 at 11:25 -0800, Sohil Mehta wrote: > From: Gayatri Kammela > +static int intel_iommu_regs_open(struct inode *inode, struct file > *file) > +{ > + return single_open(file, intel_iommu_debugfs_regs_show, > + inode->i_private); > +} > + > +static const struct file_operations intel_iommu_regs_fops = { > + .open = intel_iommu_regs_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > +}; Please, be consistent with file name and functions, i.e. intel_iommu_debugfs_regs_show -> intel_iommu_regset_show and so on. Moreover, see the patch I have just sent [1] and use same DEFINE_SHOW_ATTRIBUTE() macro here. In that case we would easily move it to seq_file.h for everyone to use in the future. > + if (!debugfs_create_file("intel_iommu_regset", S_IRUGO, > + iommu_debug_root, NULL, > &intel_iommu_regs_fops [1]: https://marc.info/?l=linux-bluetooth&m=151138535801354&w=2 -- Andy Shevchenko Intel Finland Oy From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH v2 4/6] iommu/vt-d: Add debugfs extension to show register contents Date: Wed, 22 Nov 2017 23:19:19 +0200 Message-ID: <1511385559.25007.415.camel@linux.intel.com> References: <1511378746-109275-1-git-send-email-sohil.mehta@intel.com> <1511378746-109275-5-git-send-email-sohil.mehta@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1511378746-109275-5-git-send-email-sohil.mehta-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Sohil Mehta , Joerg Roedel , Alex Williamson Cc: Ravi V Shankar , Fenghua Yu , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, David Woodhouse , Gayatri Kammela List-Id: iommu@lists.linux-foundation.org On Wed, 2017-11-22 at 11:25 -0800, Sohil Mehta wrote: > From: Gayatri Kammela > +static int intel_iommu_regs_open(struct inode *inode, struct file > *file) > +{ > + return single_open(file, intel_iommu_debugfs_regs_show, > + inode->i_private); > +} > + > +static const struct file_operations intel_iommu_regs_fops = { > + .open = intel_iommu_regs_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > +}; Please, be consistent with file name and functions, i.e. intel_iommu_debugfs_regs_show -> intel_iommu_regset_show and so on. Moreover, see the patch I have just sent [1] and use same DEFINE_SHOW_ATTRIBUTE() macro here. In that case we would easily move it to seq_file.h for everyone to use in the future. > + if (!debugfs_create_file("intel_iommu_regset", S_IRUGO, > + iommu_debug_root, NULL, > &intel_iommu_regs_fops [1]: https://marc.info/?l=linux-bluetooth&m=151138535801354&w=2 -- Andy Shevchenko Intel Finland Oy