x86/mm/pat: use DEFINE_SHOW_ATTRIBUTE to simplify cpastats
PATCH 1/1 x86/mm/pat: use DEFINE_SHOW_ATTRIBUTE to simplify cpastats
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
Signed-off-by Liu Shixin <[email protected]>
--- arch/x86/mm/pat/set_memory.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
arch/x86/mm/pat/set_memory.c +1 -12
@@ -176,18 +176,7 @@ static int cpastats_show(struct seq_file *m, void *p)seq_printf (m,"4K pages set-checked: %16lu\n" , cpa_4k_install);return 0 ; } - -static int cpastats_open (struct inode *inode,struct file *file) -{ -return single_open (file, cpastats_show,NULL ); -} - -static const struct file_operations cpastats_fops = { - .open = cpastats_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE (cpastats);static int __init cpa_stats_init (void ) {
Signature · 1 line
2.25.1