From patchwork Sat Mar 5 13:38:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lianjie Zhang X-Patchwork-Id: 12770416 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 735BDC433F5 for ; Sat, 5 Mar 2022 16:02:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.285146.484435 (Exim 4.92) (envelope-from ) id 1nQWrN-00079s-Iu; Sat, 05 Mar 2022 16:02:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 285146.484435; Sat, 05 Mar 2022 16:02:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nQWrN-00079l-G1; Sat, 05 Mar 2022 16:02:21 +0000 Received: by outflank-mailman (input) for mailman id 285146; Sat, 05 Mar 2022 13:39:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nQUcn-0003WL-EU for xen-devel@lists.xenproject.org; Sat, 05 Mar 2022 13:39:09 +0000 Received: from smtpbg152.qq.com (smtpbg152.qq.com [13.245.186.79]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9d120542-9c89-11ec-8eba-a37418f5ba1a; Sat, 05 Mar 2022 14:39:02 +0100 (CET) Received: from localhost.localdomain ( [114.222.120.105]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 05 Mar 2022 21:38:34 +0800 (CST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9d120542-9c89-11ec-8eba-a37418f5ba1a X-QQ-mid: bizesmtp80t1646487530t0ad08pm X-QQ-SSF: 01400000002000B0I000B00A0000000 X-QQ-FEAT: F3yR32iATbigXkT0FCE9DsObg5oq/MN3OGcaVKW3SzyBGnuKqNLFJhhrnBSss OEeEKWXCYXFgWxlBFjnddgdP3hYrW7Boq5CIhmIdRlax3caNoJd34bgMazPzJnmFaSCfE3U irLUm43siAqYb5/xhKRPLiPLZEVIApzI5pl3OhTu1wDyiDdpEL2zhysTrZtfdaROI3Zk+rk 1rHdciWu44nEdT/JA0tNNTgnCq3sX2lqdwmHvBWyCE27uiY+8eY2pssFLWh7wr/WMrF2ANT oVua3dfwqv32zcYaPeEnJ2bhGSnjYDtnkSG9ZN2M1T7NoWMcLMGznKLejy6drQVQBqqpDNF ShmC+9yljlPiUI2pvM= X-QQ-GoodBg: 2 From: zhanglianjie To: Juergen Gross , David Vrabel Cc: Greg Kroah-Hartman , Boris Ostrovsky , Stefano Stabellini , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Konrad Rzeszutek Wilk , zhanglianjie Subject: [PATCH] drivers/xen: use helper macro __ATTR_RW Date: Sat, 5 Mar 2022 21:38:23 +0800 Message-Id: <20220305133823.158961-1-zhanglianjie@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign6 X-QQ-Bgrelay: 1 Use helper macro __ATTR_RW to define HYPERVISOR_ATTR_RW to make code more clear. Minor readability improvement. Signed-off-by: zhanglianjie Reviewed-by: Boris Ostrovsky --- 2.20.1 diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c index feb1d16252e7..fcb0792f090e 100644 --- a/drivers/xen/sys-hypervisor.c +++ b/drivers/xen/sys-hypervisor.c @@ -22,11 +22,10 @@ #endif #define HYPERVISOR_ATTR_RO(_name) \ -static struct hyp_sysfs_attr _name##_attr = __ATTR_RO(_name) +static struct hyp_sysfs_attr _name##_attr = __ATTR_RO(_name) #define HYPERVISOR_ATTR_RW(_name) \ -static struct hyp_sysfs_attr _name##_attr = \ - __ATTR(_name, 0644, _name##_show, _name##_store) +static struct hyp_sysfs_attr _name##_attr = __ATTR_RW(_name) struct hyp_sysfs_attr { struct attribute attr;