ACPI, APEI, EINJ: Change to use DEFINE_SHOW_ATTRIBUTE macro
PATCH 1/1 ACPI, APEI, EINJ: Change to use DEFINE_SHOW_ATTRIBUTE macro
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by Yangtao Li <[email protected]>
--- drivers/acpi/apei/einj.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/acpi/apei/einj.c +1 -11
@@ -607,17 +607,7 @@ static int available_error_type_show(struct seq_file *m, void *v)return 0 ; } -static int available_error_type_open (struct inode *inode,struct file *file) -{ -return single_open (file, available_error_type_show,NULL ); -} - -static const struct file_operations available_error_type_fops = { - .open = available_error_type_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE (available_error_type);static int error_type_get (void *data,u64 *val) {
Signature · 1 line
2.17.0
Rafael J. Wysocki
AppliedQuoted 21 lines · CET Yangtao Li
Use
DEFINE_SHOW_ATTRIBUTEmacro to simplify the code.Signed-off-by Yangtao Li <[email protected]>--- drivers/acpi/apei/einj.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)drivers/acpi/apei/einj.c +0
-5@@ -607,17 +607,7 @@ static int available_error_type_show(struct seq_file *m, void *v)return 0 ; } -static int available_error_type_open (struct inode *inode,struct file *file) -{ -return single_open (file, available_error_type_show,NULL ); -} -
drivers/acpi/apei/einj.c static int available_error_type_show(struct seq_file *m, void *v) · line 613
Quoted 10 lines
drivers/acpi/apei/einj.c +1
-6-static const struct file_operations available_error_type_fops = { - .open = available_error_type_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE (available_error_type);static int error_type_get (void *data,u64 *val) {
Applied, thanks!