Skip to content

Commit

Permalink
drivers/xen: use helper macro __ATTR_RW
Browse files Browse the repository at this point in the history
Use helper macro __ATTR_RW to define HYPERVISOR_ATTR_RW to make code more clear.
Minor readability improvement.

Remove extra whitespace [boris: added this comment]

Signed-off-by: zhanglianjie <zhanglianjie@uniontech.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20220305133823.158961-1-zhanglianjie@uniontech.com
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
  • Loading branch information
zhanglianjie authored and Boris Ostrovsky committed Mar 10, 2022
1 parent b359b3a commit 982e443
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/xen/sys-hypervisor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 982e443

Please sign in to comment.