Skip to content

Commit 4ea9031

Browse files
committed
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
2 parents 383df63 + 629a5d8 commit 4ea9031

File tree

4 files changed

+177
-150
lines changed

4 files changed

+177
-150
lines changed

drivers/xen/pcpu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int xen_pcpu_up(uint32_t cpu_id)
9292
return HYPERVISOR_platform_op(&op);
9393
}
9494

95-
static ssize_t show_online(struct device *dev,
95+
static ssize_t online_show(struct device *dev,
9696
struct device_attribute *attr,
9797
char *buf)
9898
{
@@ -101,7 +101,7 @@ static ssize_t show_online(struct device *dev,
101101
return sprintf(buf, "%u\n", !!(cpu->flags & XEN_PCPU_FLAGS_ONLINE));
102102
}
103103

104-
static ssize_t __ref store_online(struct device *dev,
104+
static ssize_t __ref online_store(struct device *dev,
105105
struct device_attribute *attr,
106106
const char *buf, size_t count)
107107
{
@@ -130,7 +130,7 @@ static ssize_t __ref store_online(struct device *dev,
130130
ret = count;
131131
return ret;
132132
}
133-
static DEVICE_ATTR(online, S_IRUGO | S_IWUSR, show_online, store_online);
133+
static DEVICE_ATTR_RW(online);
134134

135135
static struct attribute *pcpu_dev_attrs[] = {
136136
&dev_attr_online.attr,

drivers/xen/xen-balloon.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ void xen_balloon_init(void)
134134
EXPORT_SYMBOL_GPL(xen_balloon_init);
135135

136136
#define BALLOON_SHOW(name, format, args...) \
137-
static ssize_t show_##name(struct device *dev, \
137+
static ssize_t name##_show(struct device *dev, \
138138
struct device_attribute *attr, \
139139
char *buf) \
140140
{ \
141141
return sprintf(buf, format, ##args); \
142142
} \
143-
static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
143+
static DEVICE_ATTR_RO(name)
144144

145145
BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages));
146146
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);
152152
static DEVICE_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count);
153153
static DEVICE_BOOL_ATTR(scrub_pages, 0644, xen_scrub_pages);
154154

155-
static ssize_t show_target_kb(struct device *dev, struct device_attribute *attr,
155+
static ssize_t target_kb_show(struct device *dev, struct device_attribute *attr,
156156
char *buf)
157157
{
158158
return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages));
159159
}
160160

161-
static ssize_t store_target_kb(struct device *dev,
161+
static ssize_t target_kb_store(struct device *dev,
162162
struct device_attribute *attr,
163-
const char *buf,
164-
size_t count)
163+
const char *buf, size_t count)
165164
{
166165
char *endchar;
167166
unsigned long long target_bytes;
@@ -176,22 +175,19 @@ static ssize_t store_target_kb(struct device *dev,
176175
return count;
177176
}
178177

179-
static DEVICE_ATTR(target_kb, S_IRUGO | S_IWUSR,
180-
show_target_kb, store_target_kb);
178+
static DEVICE_ATTR_RW(target_kb);
181179

182-
183-
static ssize_t show_target(struct device *dev, struct device_attribute *attr,
184-
char *buf)
180+
static ssize_t target_show(struct device *dev, struct device_attribute *attr,
181+
char *buf)
185182
{
186183
return sprintf(buf, "%llu\n",
187184
(unsigned long long)balloon_stats.target_pages
188185
<< PAGE_SHIFT);
189186
}
190187

191-
static ssize_t store_target(struct device *dev,
188+
static ssize_t target_store(struct device *dev,
192189
struct device_attribute *attr,
193-
const char *buf,
194-
size_t count)
190+
const char *buf, size_t count)
195191
{
196192
char *endchar;
197193
unsigned long long target_bytes;
@@ -206,9 +202,7 @@ static ssize_t store_target(struct device *dev,
206202
return count;
207203
}
208204

209-
static DEVICE_ATTR(target, S_IRUGO | S_IWUSR,
210-
show_target, store_target);
211-
205+
static DEVICE_ATTR_RW(target);
212206

213207
static struct attribute *balloon_attrs[] = {
214208
&dev_attr_target_kb.attr,

drivers/xen/xenbus/xenbus_probe.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,22 +207,22 @@ void xenbus_otherend_changed(struct xenbus_watch *watch,
207207
EXPORT_SYMBOL_GPL(xenbus_otherend_changed);
208208

209209
#define XENBUS_SHOW_STAT(name) \
210-
static ssize_t show_##name(struct device *_dev, \
210+
static ssize_t name##_show(struct device *_dev, \
211211
struct device_attribute *attr, \
212212
char *buf) \
213213
{ \
214214
struct xenbus_device *dev = to_xenbus_device(_dev); \
215215
\
216216
return sprintf(buf, "%d\n", atomic_read(&dev->name)); \
217217
} \
218-
static DEVICE_ATTR(name, 0444, show_##name, NULL)
218+
static DEVICE_ATTR_RO(name)
219219

220220
XENBUS_SHOW_STAT(event_channels);
221221
XENBUS_SHOW_STAT(events);
222222
XENBUS_SHOW_STAT(spurious_events);
223223
XENBUS_SHOW_STAT(jiffies_eoi_delayed);
224224

225-
static ssize_t show_spurious_threshold(struct device *_dev,
225+
static ssize_t spurious_threshold_show(struct device *_dev,
226226
struct device_attribute *attr,
227227
char *buf)
228228
{
@@ -231,9 +231,9 @@ static ssize_t show_spurious_threshold(struct device *_dev,
231231
return sprintf(buf, "%d\n", dev->spurious_threshold);
232232
}
233233

234-
static ssize_t set_spurious_threshold(struct device *_dev,
235-
struct device_attribute *attr,
236-
const char *buf, size_t count)
234+
static ssize_t spurious_threshold_store(struct device *_dev,
235+
struct device_attribute *attr,
236+
const char *buf, size_t count)
237237
{
238238
struct xenbus_device *dev = to_xenbus_device(_dev);
239239
unsigned int val;
@@ -248,8 +248,7 @@ static ssize_t set_spurious_threshold(struct device *_dev,
248248
return count;
249249
}
250250

251-
static DEVICE_ATTR(spurious_threshold, 0644, show_spurious_threshold,
252-
set_spurious_threshold);
251+
static DEVICE_ATTR_RW(spurious_threshold);
253252

254253
static struct attribute *xenbus_attrs[] = {
255254
&dev_attr_event_channels.attr,

0 commit comments

Comments
 (0)