Commit 4ea90317 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-5.14-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen updates from Juergen Gross:
 "Only two minor patches this time: one cleanup patch and one patch
  refreshing a Xen header"

* tag 'for-linus-5.14-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen: sync include/xen/interface/io/ring.h with Xen's newest version
  xen: Use DEVICE_ATTR_*() macro
parents 383df634 629a5d87
...@@ -92,7 +92,7 @@ static int xen_pcpu_up(uint32_t cpu_id) ...@@ -92,7 +92,7 @@ static int xen_pcpu_up(uint32_t cpu_id)
return HYPERVISOR_platform_op(&op); return HYPERVISOR_platform_op(&op);
} }
static ssize_t show_online(struct device *dev, static ssize_t online_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
...@@ -101,7 +101,7 @@ static ssize_t show_online(struct device *dev, ...@@ -101,7 +101,7 @@ static ssize_t show_online(struct device *dev,
return sprintf(buf, "%u\n", !!(cpu->flags & XEN_PCPU_FLAGS_ONLINE)); return sprintf(buf, "%u\n", !!(cpu->flags & XEN_PCPU_FLAGS_ONLINE));
} }
static ssize_t __ref store_online(struct device *dev, static ssize_t __ref online_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
...@@ -130,7 +130,7 @@ static ssize_t __ref store_online(struct device *dev, ...@@ -130,7 +130,7 @@ static ssize_t __ref store_online(struct device *dev,
ret = count; ret = count;
return ret; return ret;
} }
static DEVICE_ATTR(online, S_IRUGO | S_IWUSR, show_online, store_online); static DEVICE_ATTR_RW(online);
static struct attribute *pcpu_dev_attrs[] = { static struct attribute *pcpu_dev_attrs[] = {
&dev_attr_online.attr, &dev_attr_online.attr,
......
...@@ -134,13 +134,13 @@ void xen_balloon_init(void) ...@@ -134,13 +134,13 @@ void xen_balloon_init(void)
EXPORT_SYMBOL_GPL(xen_balloon_init); EXPORT_SYMBOL_GPL(xen_balloon_init);
#define BALLOON_SHOW(name, format, args...) \ #define BALLOON_SHOW(name, format, args...) \
static ssize_t show_##name(struct device *dev, \ static ssize_t name##_show(struct device *dev, \
struct device_attribute *attr, \ struct device_attribute *attr, \
char *buf) \ char *buf) \
{ \ { \
return sprintf(buf, format, ##args); \ return sprintf(buf, format, ##args); \
} \ } \
static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) static DEVICE_ATTR_RO(name)
BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages)); BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages));
BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low)); BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low));
...@@ -152,16 +152,15 @@ static DEVICE_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count); ...@@ -152,16 +152,15 @@ static DEVICE_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count);
static DEVICE_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count); static DEVICE_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count);
static DEVICE_BOOL_ATTR(scrub_pages, 0644, xen_scrub_pages); static DEVICE_BOOL_ATTR(scrub_pages, 0644, xen_scrub_pages);
static ssize_t show_target_kb(struct device *dev, struct device_attribute *attr, static ssize_t target_kb_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages)); return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages));
} }
static ssize_t store_target_kb(struct device *dev, static ssize_t target_kb_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf, size_t count)
size_t count)
{ {
char *endchar; char *endchar;
unsigned long long target_bytes; unsigned long long target_bytes;
...@@ -176,22 +175,19 @@ static ssize_t store_target_kb(struct device *dev, ...@@ -176,22 +175,19 @@ static ssize_t store_target_kb(struct device *dev,
return count; return count;
} }
static DEVICE_ATTR(target_kb, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(target_kb);
show_target_kb, store_target_kb);
static ssize_t target_show(struct device *dev, struct device_attribute *attr,
static ssize_t show_target(struct device *dev, struct device_attribute *attr, char *buf)
char *buf)
{ {
return sprintf(buf, "%llu\n", return sprintf(buf, "%llu\n",
(unsigned long long)balloon_stats.target_pages (unsigned long long)balloon_stats.target_pages
<< PAGE_SHIFT); << PAGE_SHIFT);
} }
static ssize_t store_target(struct device *dev, static ssize_t target_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf, size_t count)
size_t count)
{ {
char *endchar; char *endchar;
unsigned long long target_bytes; unsigned long long target_bytes;
...@@ -206,9 +202,7 @@ static ssize_t store_target(struct device *dev, ...@@ -206,9 +202,7 @@ static ssize_t store_target(struct device *dev,
return count; return count;
} }
static DEVICE_ATTR(target, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(target);
show_target, store_target);
static struct attribute *balloon_attrs[] = { static struct attribute *balloon_attrs[] = {
&dev_attr_target_kb.attr, &dev_attr_target_kb.attr,
......
...@@ -207,7 +207,7 @@ void xenbus_otherend_changed(struct xenbus_watch *watch, ...@@ -207,7 +207,7 @@ void xenbus_otherend_changed(struct xenbus_watch *watch,
EXPORT_SYMBOL_GPL(xenbus_otherend_changed); EXPORT_SYMBOL_GPL(xenbus_otherend_changed);
#define XENBUS_SHOW_STAT(name) \ #define XENBUS_SHOW_STAT(name) \
static ssize_t show_##name(struct device *_dev, \ static ssize_t name##_show(struct device *_dev, \
struct device_attribute *attr, \ struct device_attribute *attr, \
char *buf) \ char *buf) \
{ \ { \
...@@ -215,14 +215,14 @@ static ssize_t show_##name(struct device *_dev, \ ...@@ -215,14 +215,14 @@ static ssize_t show_##name(struct device *_dev, \
\ \
return sprintf(buf, "%d\n", atomic_read(&dev->name)); \ return sprintf(buf, "%d\n", atomic_read(&dev->name)); \
} \ } \
static DEVICE_ATTR(name, 0444, show_##name, NULL) static DEVICE_ATTR_RO(name)
XENBUS_SHOW_STAT(event_channels); XENBUS_SHOW_STAT(event_channels);
XENBUS_SHOW_STAT(events); XENBUS_SHOW_STAT(events);
XENBUS_SHOW_STAT(spurious_events); XENBUS_SHOW_STAT(spurious_events);
XENBUS_SHOW_STAT(jiffies_eoi_delayed); XENBUS_SHOW_STAT(jiffies_eoi_delayed);
static ssize_t show_spurious_threshold(struct device *_dev, static ssize_t spurious_threshold_show(struct device *_dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
...@@ -231,9 +231,9 @@ static ssize_t show_spurious_threshold(struct device *_dev, ...@@ -231,9 +231,9 @@ static ssize_t show_spurious_threshold(struct device *_dev,
return sprintf(buf, "%d\n", dev->spurious_threshold); return sprintf(buf, "%d\n", dev->spurious_threshold);
} }
static ssize_t set_spurious_threshold(struct device *_dev, static ssize_t spurious_threshold_store(struct device *_dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct xenbus_device *dev = to_xenbus_device(_dev); struct xenbus_device *dev = to_xenbus_device(_dev);
unsigned int val; unsigned int val;
...@@ -248,8 +248,7 @@ static ssize_t set_spurious_threshold(struct device *_dev, ...@@ -248,8 +248,7 @@ static ssize_t set_spurious_threshold(struct device *_dev,
return count; return count;
} }
static DEVICE_ATTR(spurious_threshold, 0644, show_spurious_threshold, static DEVICE_ATTR_RW(spurious_threshold);
set_spurious_threshold);
static struct attribute *xenbus_attrs[] = { static struct attribute *xenbus_attrs[] = {
&dev_attr_event_channels.attr, &dev_attr_event_channels.attr,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment