linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/fadump: Change to use DEFINE_SHOW_ATTRIBUTE macro
@ 2018-11-05 15:01 Yangtao Li
  2018-11-06  0:07 ` David Gibson
  2018-11-27  9:22 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Yangtao Li @ 2018-11-05 15:01 UTC (permalink / raw)
  To: benh, paulus, mpe, hbathini, mahesh, david, msuchanek
  Cc: linuxppc-dev, linux-kernel, Yangtao Li

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 arch/powerpc/kernel/fadump.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index a711d22339ea..2df5e04b5afc 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1531,17 +1531,7 @@ static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered,
 						0644, fadump_register_show,
 						fadump_register_store);
 
-static int fadump_region_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, fadump_region_show, inode->i_private);
-}
-
-static const struct file_operations fadump_region_fops = {
-	.open    = fadump_region_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(fadump_region);
 
 static void fadump_init_files(void)
 {
-- 
2.17.0


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

* Re: [PATCH] powerpc/fadump: Change to use DEFINE_SHOW_ATTRIBUTE macro
  2018-11-05 15:01 [PATCH] powerpc/fadump: Change to use DEFINE_SHOW_ATTRIBUTE macro Yangtao Li
@ 2018-11-06  0:07 ` David Gibson
  2018-11-27  9:22 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2018-11-06  0:07 UTC (permalink / raw)
  To: Yangtao Li
  Cc: benh, paulus, mpe, hbathini, mahesh, msuchanek, linuxppc-dev,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

On Mon, Nov 05, 2018 at 10:01:19AM -0500, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  arch/powerpc/kernel/fadump.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index a711d22339ea..2df5e04b5afc 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -1531,17 +1531,7 @@ static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered,
>  						0644, fadump_register_show,
>  						fadump_register_store);
>  
> -static int fadump_region_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, fadump_region_show, inode->i_private);
> -}
> -
> -static const struct file_operations fadump_region_fops = {
> -	.open    = fadump_region_open,
> -	.read    = seq_read,
> -	.llseek  = seq_lseek,
> -	.release = single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(fadump_region);
>  
>  static void fadump_init_files(void)
>  {

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: powerpc/fadump: Change to use DEFINE_SHOW_ATTRIBUTE macro
  2018-11-05 15:01 [PATCH] powerpc/fadump: Change to use DEFINE_SHOW_ATTRIBUTE macro Yangtao Li
  2018-11-06  0:07 ` David Gibson
@ 2018-11-27  9:22 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-11-27  9:22 UTC (permalink / raw)
  To: Yangtao Li, benh, paulus, hbathini, mahesh, david, msuchanek
  Cc: Yangtao Li, linuxppc-dev, linux-kernel

On Mon, 2018-11-05 at 15:01:19 UTC, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f6cee260309807acb12ff84524ffc8

cheers

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

end of thread, other threads:[~2018-11-27  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05 15:01 [PATCH] powerpc/fadump: Change to use DEFINE_SHOW_ATTRIBUTE macro Yangtao Li
2018-11-06  0:07 ` David Gibson
2018-11-27  9:22 ` Michael Ellerman

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).