s390/diag: convert to use DEFINE_SEQ_ATTRIBUTE macro
authorLiu Shixin <liushixin2@huawei.com>
Wed, 16 Sep 2020 02:50:29 +0000 (10:50 +0800)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 17 Sep 2020 12:11:03 +0000 (14:11 +0200)
Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/diag.c

index ccba63a..b8b0cd7 100644 (file)
@@ -104,18 +104,7 @@ static const struct seq_operations show_diag_stat_sops = {
        .show   = show_diag_stat,
 };
 
-static int show_diag_stat_open(struct inode *inode, struct file *file)
-{
-       return seq_open(file, &show_diag_stat_sops);
-}
-
-static const struct file_operations show_diag_stat_fops = {
-       .open           = show_diag_stat_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = seq_release,
-};
-
+DEFINE_SEQ_ATTRIBUTE(show_diag_stat);
 
 static int __init show_diag_stat_init(void)
 {