linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro
@ 2018-02-14 15:47 Andy Shevchenko
  2018-02-14 16:04 ` Marc Zyngier
  2018-02-16 13:51 ` Marc Zyngier
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Shevchenko @ 2018-02-14 15:47 UTC (permalink / raw)
  To: Marc Zyngier, Thomas Gleixner, linux-kernel; +Cc: Andy Shevchenko

...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 kernel/irq/irqdomain.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index e6a9c36470ee..82b8b18ee1eb 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1726,25 +1726,14 @@ static int irq_domain_debug_show(struct seq_file *m, void *p)
 	irq_domain_debug_show_one(m, d, 0);
 	return 0;
 }
-
-static int irq_domain_debug_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, irq_domain_debug_show, inode->i_private);
-}
-
-static const struct file_operations dfs_domain_ops = {
-	.open		= irq_domain_debug_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(irq_domain_debug);
 
 static void debugfs_add_domain_dir(struct irq_domain *d)
 {
 	if (!d->name || !domain_dir || d->debugfs_file)
 		return;
 	d->debugfs_file = debugfs_create_file(d->name, 0444, domain_dir, d,
-					      &dfs_domain_ops);
+					      &irq_domain_debug_fops);
 }
 
 static void debugfs_remove_domain_dir(struct irq_domain *d)
@@ -1760,7 +1749,8 @@ void __init irq_domain_debugfs_init(struct dentry *root)
 	if (!domain_dir)
 		return;
 
-	debugfs_create_file("default", 0444, domain_dir, NULL, &dfs_domain_ops);
+	debugfs_create_file("default", 0444, domain_dir, NULL,
+			    &irq_domain_debug_fops);
 	mutex_lock(&irq_domain_mutex);
 	list_for_each_entry(d, &irq_domain_list, link)
 		debugfs_add_domain_dir(d);
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  2018-02-14 15:47 [PATCH v1] irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro Andy Shevchenko
@ 2018-02-14 16:04 ` Marc Zyngier
  2018-02-14 16:08   ` Thomas Gleixner
  2018-02-16 13:51 ` Marc Zyngier
  1 sibling, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2018-02-14 16:04 UTC (permalink / raw)
  To: Andy Shevchenko, Thomas Gleixner, linux-kernel

On 14/02/18 15:47, Andy Shevchenko wrote:
> ...instead of open coding file operations followed by custom ->open()
> callbacks per each attribute.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Too late... ;-)

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/kernel/irq/irqdomain.c?id=c5baa1be8f559d5f33c412d00cc1c86762a8bbbf

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  2018-02-14 16:04 ` Marc Zyngier
@ 2018-02-14 16:08   ` Thomas Gleixner
  2018-02-14 16:14     ` Marc Zyngier
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2018-02-14 16:08 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Andy Shevchenko, linux-kernel

On Wed, 14 Feb 2018, Marc Zyngier wrote:

> On 14/02/18 15:47, Andy Shevchenko wrote:
> > ...instead of open coding file operations followed by custom ->open()
> > callbacks per each attribute.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Too late... ;-)
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/kernel/irq/irqdomain.c?id=c5baa1be8f559d5f33c412d00cc1c86762a8bbbf

You're slighly off. The patch is against the CONFIG_GENERIC_IRQ_DEBUGFS
infrastructure and that's still there :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  2018-02-14 16:08   ` Thomas Gleixner
@ 2018-02-14 16:14     ` Marc Zyngier
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2018-02-14 16:14 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Andy Shevchenko, linux-kernel

On 14/02/18 16:08, Thomas Gleixner wrote:
> On Wed, 14 Feb 2018, Marc Zyngier wrote:
> 
>> On 14/02/18 15:47, Andy Shevchenko wrote:
>>> ...instead of open coding file operations followed by custom ->open()
>>> callbacks per each attribute.
>>>
>>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>
>> Too late... ;-)
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/kernel/irq/irqdomain.c?id=c5baa1be8f559d5f33c412d00cc1c86762a8bbbf
> 
> You're slighly off. The patch is against the CONFIG_GENERIC_IRQ_DEBUGFS
> infrastructure and that's still there :)

Gah, I missed that... Sorry about the noise, I'll read that more
carefully (/me grabs a brown paper bag...).

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  2018-02-14 15:47 [PATCH v1] irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro Andy Shevchenko
  2018-02-14 16:04 ` Marc Zyngier
@ 2018-02-16 13:51 ` Marc Zyngier
  1 sibling, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2018-02-16 13:51 UTC (permalink / raw)
  To: Andy Shevchenko, Thomas Gleixner, linux-kernel

On 14/02/18 15:47, Andy Shevchenko wrote:
> ...instead of open coding file operations followed by custom ->open()
> callbacks per each attribute.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  kernel/irq/irqdomain.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)

Applied, thanks.

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-16 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14 15:47 [PATCH v1] irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro Andy Shevchenko
2018-02-14 16:04 ` Marc Zyngier
2018-02-14 16:08   ` Thomas Gleixner
2018-02-14 16:14     ` Marc Zyngier
2018-02-16 13:51 ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).