* [PATCH] iommu/tegra: Change to use DEFINE_SHOW_ATTRIBUTE macro
@ 2018-11-22 13:30 Yangtao Li
[not found] ` <20181122133047.24902-1-tiny.windzz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-11-22 16:10 ` Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Yangtao Li @ 2018-11-22 13:30 UTC (permalink / raw)
To: thierry.reding, joro, jonathanh
Cc: linux-tegra, iommu, linux-kernel, Yangtao Li
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
drivers/iommu/tegra-smmu.c | 24 ++----------------------
1 file changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 0d03341317c4..97b3c0461831 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -926,17 +926,7 @@ static int tegra_smmu_swgroups_show(struct seq_file *s, void *data)
return 0;
}
-static int tegra_smmu_swgroups_open(struct inode *inode, struct file *file)
-{
- return single_open(file, tegra_smmu_swgroups_show, inode->i_private);
-}
-
-static const struct file_operations tegra_smmu_swgroups_fops = {
- .open = tegra_smmu_swgroups_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(tegra_smmu_swgroups);
static int tegra_smmu_clients_show(struct seq_file *s, void *data)
{
@@ -964,17 +954,7 @@ static int tegra_smmu_clients_show(struct seq_file *s, void *data)
return 0;
}
-static int tegra_smmu_clients_open(struct inode *inode, struct file *file)
-{
- return single_open(file, tegra_smmu_clients_show, inode->i_private);
-}
-
-static const struct file_operations tegra_smmu_clients_fops = {
- .open = tegra_smmu_clients_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(tegra_smmu_clients);
static void tegra_smmu_debugfs_init(struct tegra_smmu *smmu)
{
--
2.17.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iommu/tegra: Change to use DEFINE_SHOW_ATTRIBUTE macro
[not found] ` <20181122133047.24902-1-tiny.windzz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-11-22 15:15 ` Thierry Reding
0 siblings, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2018-11-22 15:15 UTC (permalink / raw)
To: Yangtao Li
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
jonathanh-DDmLM1+adcrQT0dZR+AlfA
[-- Attachment #1.1: Type: text/plain, Size: 404 bytes --]
On Thu, Nov 22, 2018 at 08:30:47AM -0500, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>
> Signed-off-by: Yangtao Li <tiny.windzz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/iommu/tegra-smmu.c | 24 ++----------------------
> 1 file changed, 2 insertions(+), 22 deletions(-)
Acked-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iommu/tegra: Change to use DEFINE_SHOW_ATTRIBUTE macro
2018-11-22 13:30 [PATCH] iommu/tegra: Change to use DEFINE_SHOW_ATTRIBUTE macro Yangtao Li
[not found] ` <20181122133047.24902-1-tiny.windzz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-11-22 16:10 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2018-11-22 16:10 UTC (permalink / raw)
To: Yangtao Li; +Cc: thierry.reding, jonathanh, linux-tegra, iommu, linux-kernel
On Thu, Nov 22, 2018 at 08:30:47AM -0500, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
> drivers/iommu/tegra-smmu.c | 24 ++----------------------
> 1 file changed, 2 insertions(+), 22 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-22 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-22 13:30 [PATCH] iommu/tegra: Change to use DEFINE_SHOW_ATTRIBUTE macro Yangtao Li
[not found] ` <20181122133047.24902-1-tiny.windzz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-11-22 15:15 ` Thierry Reding
2018-11-22 16:10 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox