Skip to content

Commit fd708e4

Browse files
author
Fox Snowpatch
committedDec 16, 2024·
1 parent 2dd0957 commit fd708e4

File tree

8 files changed

+33
-33
lines changed

8 files changed

+33
-33
lines changed
 

‎arch/powerpc/kernel/secvar-sysfs.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr,
5252
}
5353

5454
static ssize_t data_read(struct file *filep, struct kobject *kobj,
55-
struct bin_attribute *attr, char *buf, loff_t off,
55+
const struct bin_attribute *attr, char *buf, loff_t off,
5656
size_t count)
5757
{
5858
char *data;
@@ -85,7 +85,7 @@ static ssize_t data_read(struct file *filep, struct kobject *kobj,
8585
}
8686

8787
static ssize_t update_write(struct file *filep, struct kobject *kobj,
88-
struct bin_attribute *attr, char *buf, loff_t off,
88+
const struct bin_attribute *attr, char *buf, loff_t off,
8989
size_t count)
9090
{
9191
int rc;
@@ -104,11 +104,11 @@ static struct kobj_attribute format_attr = __ATTR_RO(format);
104104

105105
static struct kobj_attribute size_attr = __ATTR_RO(size);
106106

107-
static struct bin_attribute data_attr = __BIN_ATTR_RO(data, 0);
107+
static struct bin_attribute data_attr __ro_after_init = __BIN_ATTR_RO(data, 0);
108108

109-
static struct bin_attribute update_attr = __BIN_ATTR_WO(update, 0);
109+
static struct bin_attribute update_attr __ro_after_init = __BIN_ATTR_WO(update, 0);
110110

111-
static struct bin_attribute *secvar_bin_attrs[] = {
111+
static const struct bin_attribute *const secvar_bin_attrs[] = {
112112
&data_attr,
113113
&update_attr,
114114
NULL,
@@ -121,7 +121,7 @@ static struct attribute *secvar_attrs[] = {
121121

122122
static const struct attribute_group secvar_attr_group = {
123123
.attrs = secvar_attrs,
124-
.bin_attrs = secvar_bin_attrs,
124+
.bin_attrs_new = secvar_bin_attrs,
125125
};
126126
__ATTRIBUTE_GROUPS(secvar_attr);
127127

@@ -130,7 +130,7 @@ static const struct kobj_type secvar_ktype = {
130130
.default_groups = secvar_attr_groups,
131131
};
132132

133-
static int update_kobj_size(void)
133+
static __init int update_kobj_size(void)
134134
{
135135

136136
u64 varsize;
@@ -145,7 +145,7 @@ static int update_kobj_size(void)
145145
return 0;
146146
}
147147

148-
static int secvar_sysfs_config(struct kobject *kobj)
148+
static __init int secvar_sysfs_config(struct kobject *kobj)
149149
{
150150
struct attribute_group config_group = {
151151
.name = "config",
@@ -158,7 +158,7 @@ static int secvar_sysfs_config(struct kobject *kobj)
158158
return 0;
159159
}
160160

161-
static int add_var(const char *name)
161+
static __init int add_var(const char *name)
162162
{
163163
struct kobject *kobj;
164164
int rc;
@@ -181,7 +181,7 @@ static int add_var(const char *name)
181181
return 0;
182182
}
183183

184-
static int secvar_sysfs_load(void)
184+
static __init int secvar_sysfs_load(void)
185185
{
186186
u64 namesize = 0;
187187
char *name;
@@ -209,7 +209,7 @@ static int secvar_sysfs_load(void)
209209
return rc;
210210
}
211211

212-
static int secvar_sysfs_load_static(void)
212+
static __init int secvar_sysfs_load_static(void)
213213
{
214214
const char * const *name_ptr = secvar_ops->var_names;
215215
int rc;
@@ -224,7 +224,7 @@ static int secvar_sysfs_load_static(void)
224224
return 0;
225225
}
226226

227-
static int secvar_sysfs_init(void)
227+
static __init int secvar_sysfs_init(void)
228228
{
229229
u64 max_size;
230230
int rc;

‎arch/powerpc/perf/hv-24x7.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ static int create_events_from_catalog(struct attribute ***events_,
998998
}
999999

10001000
static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
1001-
struct bin_attribute *bin_attr, char *buf,
1001+
const struct bin_attribute *bin_attr, char *buf,
10021002
loff_t offset, size_t count)
10031003
{
10041004
long hret;
@@ -1108,14 +1108,14 @@ PAGE_0_ATTR(catalog_version, "%lld\n",
11081108
(unsigned long long)be64_to_cpu(page_0->version));
11091109
PAGE_0_ATTR(catalog_len, "%lld\n",
11101110
(unsigned long long)be32_to_cpu(page_0->length) * 4096);
1111-
static BIN_ATTR_RO(catalog, 0/* real length varies */);
1111+
static const BIN_ATTR_RO(catalog, 0/* real length varies */);
11121112
static DEVICE_ATTR_RO(domains);
11131113
static DEVICE_ATTR_RO(sockets);
11141114
static DEVICE_ATTR_RO(chipspersocket);
11151115
static DEVICE_ATTR_RO(coresperchip);
11161116
static DEVICE_ATTR_RO(cpumask);
11171117

1118-
static struct bin_attribute *if_bin_attrs[] = {
1118+
static const struct bin_attribute *const if_bin_attrs[] = {
11191119
&bin_attr_catalog,
11201120
NULL,
11211121
};
@@ -1141,7 +1141,7 @@ static struct attribute *if_attrs[] = {
11411141

11421142
static const struct attribute_group if_group = {
11431143
.name = "interface",
1144-
.bin_attrs = if_bin_attrs,
1144+
.bin_attrs_new = if_bin_attrs,
11451145
.attrs = if_attrs,
11461146
};
11471147

‎arch/powerpc/platforms/powernv/opal-core.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static Elf64_Word *__init auxv_to_elf64_notes(Elf64_Word *buf,
159159
* Returns number of bytes read on success, -errno on failure.
160160
*/
161161
static ssize_t read_opalcore(struct file *file, struct kobject *kobj,
162-
struct bin_attribute *bin_attr, char *to,
162+
const struct bin_attribute *bin_attr, char *to,
163163
loff_t pos, size_t count)
164164
{
165165
struct opalcore *m;
@@ -206,9 +206,9 @@ static ssize_t read_opalcore(struct file *file, struct kobject *kobj,
206206
return (tpos - pos);
207207
}
208208

209-
static struct bin_attribute opal_core_attr = {
209+
static struct bin_attribute opal_core_attr __ro_after_init = {
210210
.attr = {.name = "core", .mode = 0400},
211-
.read = read_opalcore
211+
.read_new = read_opalcore
212212
};
213213

214214
/*
@@ -599,15 +599,15 @@ static struct attribute *mpipl_attr[] = {
599599
NULL,
600600
};
601601

602-
static struct bin_attribute *mpipl_bin_attr[] = {
602+
static const struct bin_attribute *const mpipl_bin_attr[] = {
603603
&opal_core_attr,
604604
NULL,
605605

606606
};
607607

608608
static const struct attribute_group mpipl_group = {
609609
.attrs = mpipl_attr,
610-
.bin_attrs = mpipl_bin_attr,
610+
.bin_attrs_new = mpipl_bin_attr,
611611
};
612612

613613
static int __init opalcore_init(void)

‎arch/powerpc/platforms/powernv/opal-dump.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int64_t dump_read_data(struct dump_obj *dump)
286286
}
287287

288288
static ssize_t dump_attr_read(struct file *filep, struct kobject *kobj,
289-
struct bin_attribute *bin_attr,
289+
const struct bin_attribute *bin_attr,
290290
char *buffer, loff_t pos, size_t count)
291291
{
292292
ssize_t rc;
@@ -342,7 +342,7 @@ static void create_dump_obj(uint32_t id, size_t size, uint32_t type)
342342
dump->dump_attr.attr.name = "dump";
343343
dump->dump_attr.attr.mode = 0400;
344344
dump->dump_attr.size = size;
345-
dump->dump_attr.read = dump_attr_read;
345+
dump->dump_attr.read_new = dump_attr_read;
346346

347347
dump->id = id;
348348
dump->size = size;

‎arch/powerpc/platforms/powernv/opal-elog.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static const struct kobj_type elog_ktype = {
156156
#define OPAL_MAX_ERRLOG_SIZE 16384
157157

158158
static ssize_t raw_attr_read(struct file *filep, struct kobject *kobj,
159-
struct bin_attribute *bin_attr,
159+
const struct bin_attribute *bin_attr,
160160
char *buffer, loff_t pos, size_t count)
161161
{
162162
int opal_rc;
@@ -203,7 +203,7 @@ static void create_elog_obj(uint64_t id, size_t size, uint64_t type)
203203
elog->raw_attr.attr.name = "raw";
204204
elog->raw_attr.attr.mode = 0400;
205205
elog->raw_attr.size = size;
206-
elog->raw_attr.read = raw_attr_read;
206+
elog->raw_attr.read_new = raw_attr_read;
207207

208208
elog->id = id;
209209
elog->size = size;

‎arch/powerpc/platforms/powernv/opal-flash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ static int alloc_image_buf(char *buffer, size_t count)
432432
* and pre-allocate required memory.
433433
*/
434434
static ssize_t image_data_write(struct file *filp, struct kobject *kobj,
435-
struct bin_attribute *bin_attr,
435+
const struct bin_attribute *bin_attr,
436436
char *buffer, loff_t pos, size_t count)
437437
{
438438
int rc;
@@ -493,7 +493,7 @@ static ssize_t image_data_write(struct file *filp, struct kobject *kobj,
493493
static const struct bin_attribute image_data_attr = {
494494
.attr = {.name = "image", .mode = 0200},
495495
.size = MAX_IMAGE_SIZE, /* Limit image size */
496-
.write = image_data_write,
496+
.write_new = image_data_write,
497497
};
498498

499499
static struct kobj_attribute validate_attribute =

‎arch/powerpc/platforms/powernv/opal-msglog.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ ssize_t opal_msglog_copy(char *to, loff_t pos, size_t count)
9494
}
9595

9696
static ssize_t opal_msglog_read(struct file *file, struct kobject *kobj,
97-
struct bin_attribute *bin_attr, char *to,
97+
const struct bin_attribute *bin_attr, char *to,
9898
loff_t pos, size_t count)
9999
{
100100
return opal_msglog_copy(to, pos, count);
101101
}
102102

103-
static struct bin_attribute opal_msglog_attr = {
103+
static struct bin_attribute opal_msglog_attr __ro_after_init = {
104104
.attr = {.name = "msglog", .mode = 0400},
105-
.read = opal_msglog_read
105+
.read_new = opal_msglog_read
106106
};
107107

108108
struct memcons *__init memcons_init(struct device_node *node, const char *mc_prop_name)

‎arch/powerpc/platforms/powernv/ultravisor.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ int __init early_init_dt_scan_ultravisor(unsigned long node, const char *uname,
3232
static struct memcons *uv_memcons;
3333

3434
static ssize_t uv_msglog_read(struct file *file, struct kobject *kobj,
35-
struct bin_attribute *bin_attr, char *to,
35+
const struct bin_attribute *bin_attr, char *to,
3636
loff_t pos, size_t count)
3737
{
3838
return memcons_copy(uv_memcons, to, pos, count);
3939
}
4040

41-
static struct bin_attribute uv_msglog_attr = {
41+
static struct bin_attribute uv_msglog_attr __ro_after_init = {
4242
.attr = {.name = "msglog", .mode = 0400},
43-
.read = uv_msglog_read
43+
.read_new = uv_msglog_read
4444
};
4545

4646
static int __init uv_init(void)

0 commit comments

Comments
 (0)
Please sign in to comment.