From patchwork Sat Sep 19 02:52:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qinglang Miao X-Patchwork-Id: 11786609 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81682618 for ; Sat, 19 Sep 2020 02:53:56 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D91F208DB for ; Sat, 19 Sep 2020 02:53:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D91F208DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kJSyj-0007HA-Qo; Sat, 19 Sep 2020 02:51:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kJSyi-0007H5-PF for xen-devel@lists.xenproject.org; Sat, 19 Sep 2020 02:51:56 +0000 X-Inumbo-ID: 05b2b31b-3dcc-45a4-9873-8f9232875c57 Received: from huawei.com (unknown [45.249.212.35]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 05b2b31b-3dcc-45a4-9873-8f9232875c57; Sat, 19 Sep 2020 02:51:51 +0000 (UTC) Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 47D864FA4E1449EC3C6F; Sat, 19 Sep 2020 10:51:47 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Sat, 19 Sep 2020 10:51:37 +0800 From: Qinglang Miao To: Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Thomas Gleixner" , Ingo Molnar , "Borislav Petkov" , , "H. Peter Anvin" CC: , , "Qinglang Miao" Subject: [PATCH -next v2] x86/xen: Convert to DEFINE_SHOW_ATTRIBUTE Date: Sat, 19 Sep 2020 10:52:09 +0800 Message-ID: <20200919025209.17930-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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. arch/x86/xen/p2m.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index be4151f42..3301875dd 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -795,17 +795,7 @@ static int p2m_dump_show(struct seq_file *m, void *v) return 0; } -static int p2m_dump_open(struct inode *inode, struct file *filp) -{ - return single_open(filp, p2m_dump_show, NULL); -} - -static const struct file_operations p2m_dump_fops = { - .open = p2m_dump_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(p2m_dump); static struct dentry *d_mmu_debug;