From nobody Sun Apr 28 23:30:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1600347341; cv=none; d=zohomail.com; s=zohoarc; b=hlUJ5GSUMqj3OHjiv4KBhXCu1NqHEF3N0KVoB4zy6RucfEC2yhn2mELUeATqxKQZm0GECKe3tP6W04ub6d2YX+gk/bVn9V9HKWLP48DBrU9Vi+892KC6Vp51IBePVv4I1ixRpuGbQFAdEze4sd6sqmBwuhaPyphhxv2Oantvzgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600347341; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LibXQ/Q78Y8Mybx+PMP+r0sjh4fIwQzeScpfDhjDLhQ=; b=Nj4UP1GzAgHvfUX1aenx7qIZeYM2UXZ7CzGe5VE0Gdmowf9zhKZ2k/Mk8UCJ0rE8ibxozWgqaWWn8y3eCjY29PM/cyiI9Qi0qu/OyG+0RtbeAPDDJ8KtBR0fM683f0mmVNRbQfCSi0BwVsjtFOugaecVPNDKA4115YmZA+39SVg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1600347341347128.84283261585927; Thu, 17 Sep 2020 05:55:41 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kItRf-0004Ap-Rz; Thu, 17 Sep 2020 12:55:27 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kItRe-0004Ag-OG for xen-devel@lists.xenproject.org; Thu, 17 Sep 2020 12:55:26 +0000 Received: from huawei.com (unknown [45.249.212.191]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9868f804-05e2-490b-b7c0-9fac68cdb819; Thu, 17 Sep 2020 12:55:21 +0000 (UTC) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B32109264EA415BF75E2; Thu, 17 Sep 2020 20:55:17 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Thu, 17 Sep 2020 20:55:10 +0800 X-Inumbo-ID: 9868f804-05e2-490b-b7c0-9fac68cdb819 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: Thu, 17 Sep 2020 20:55:47 +0800 Message-ID: <20200917125547.104472-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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" Content-Type: text/plain; charset="utf-8" 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; } =20 -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 =3D { - .open =3D p2m_dump_open, - .read =3D seq_read, - .llseek =3D seq_lseek, - .release =3D single_release, -}; +DEFINE_SHOW_ATTRIBUTE(p2m_dump); =20 static struct dentry *d_mmu_debug; =20 --=20 2.23.0