Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1643518pxk; Fri, 18 Sep 2020 19:53:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGcfwvZSNPlAk0luuTYrwA8la8uo4D78O5eaymopozjLZTh8OjCkEuoQZ5EAHLh6XpB6ID X-Received: by 2002:a17:907:104c:: with SMTP id oy12mr40011220ejb.450.1600484009049; Fri, 18 Sep 2020 19:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600484009; cv=none; d=google.com; s=arc-20160816; b=gwX0FU/Vn8sQrVSIzRhPMKD0c/5ly8opeRUNTPv8WN1c+tX/7p5GLaBuStTTER8cjn ONF21jJpNKHsn60wr6PLNTBf1tnLRUVRfcnotoVbruMWkLa9ApelYX9GH6c48vgASksY zxTjaFpoSZJXdhkFiQjwxUxLlc487Xbibg8neSAf5Axt7tKDt4TOGRLVi1qb57FrAzoP S2UgtVszzGxRFRzF1NY2rAkxVncH5i/aZu6UygI0XER0afmJmqJfmxTI6qSP9JAsJkZs ah1vAoYvh8j07CCWgg/arU0H4MyPPOu50hhUpbBWCe85/RmlKCt1SpgERH8Vr6vjH3ku 1K/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=fTppJn3cFV1IZAFXUfhc1o1EruyatjNZuGoM4v3Nmb4=; b=RbfJMd2o1XxKMNzi+6EOMtBR9+bX5jcO7XQnOyYoq1u6c1d2CdNIy+s+tew89kwOiy JQFcwTOUfi2MaT3leRuLqqPrYCnxRy826VAHaFiAavV2iMm3mTojSbFN2xlfE/lXyKmt qleaRvBacNxz7jnNf7185CRT60amVrGLn1+X4/6oBMfuaa8RlnSXYVRGhk5U1Ctr4b7a qQPIoXYZeiOPtXWEOv0RWXrd/DqGr0TF6he5yM1cctzvJRU/5T3TOKG8hrVAFGatFhel czwQ0PnMg8ACKDerncu/1iq82Dw3BGsV0j8ACxnCSK8ewFdvuJHLU2ufBxhHHgt3/nrS VMfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs1si4722334edb.6.2020.09.18.19.53.06; Fri, 18 Sep 2020 19:53:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726441AbgISCvu (ORCPT + 99 others); Fri, 18 Sep 2020 22:51:50 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13717 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726406AbgISCvo (ORCPT ); Fri, 18 Sep 2020 22:51:44 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id BA0F121CB20FF9F68158; Sat, 19 Sep 2020 10:51:42 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Sat, 19 Sep 2020 10:51:34 +0800 From: Qinglang Miao To: Yoshinori Sato , Rich Felker CC: , , Qinglang Miao Subject: [PATCH -next v2] sh: intc: Convert to DEFINE_SHOW_ATTRIBUTE Date: Sat, 19 Sep 2020 10:52:06 +0800 Message-ID: <20200919025206.17729-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/sh/intc/virq-debugfs.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/sh/intc/virq-debugfs.c b/drivers/sh/intc/virq-debugfs.c index 9e62ba931..939915a07 100644 --- a/drivers/sh/intc/virq-debugfs.c +++ b/drivers/sh/intc/virq-debugfs.c @@ -16,7 +16,7 @@ #include #include "internals.h" -static int intc_irq_xlate_debug(struct seq_file *m, void *priv) +static int intc_irq_xlate_show(struct seq_file *m, void *priv) { int i; @@ -37,17 +37,7 @@ static int intc_irq_xlate_debug(struct seq_file *m, void *priv) return 0; } -static int intc_irq_xlate_open(struct inode *inode, struct file *file) -{ - return single_open(file, intc_irq_xlate_debug, inode->i_private); -} - -static const struct file_operations intc_irq_xlate_fops = { - .open = intc_irq_xlate_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(intc_irq_xlate); static int __init intc_irq_xlate_init(void) { -- 2.23.0