14
14
#define CPACF_QUERY (name , instruction ) \
15
15
static ssize_t name##_query_raw_read(struct file *fp, \
16
16
struct kobject *kobj, \
17
- struct bin_attribute *attr, \
17
+ const struct bin_attribute *attr, \
18
18
char *buf, loff_t offs, \
19
19
size_t count) \
20
20
{ \
@@ -24,7 +24,7 @@ static ssize_t name##_query_raw_read(struct file *fp, \
24
24
return -EOPNOTSUPP; \
25
25
return memory_read_from_buffer(buf, count, &offs, &mask, sizeof(mask)); \
26
26
} \
27
- static BIN_ATTR_RO(name##_query_raw, sizeof(cpacf_mask_t))
27
+ static const BIN_ATTR_RO(name##_query_raw, sizeof(cpacf_mask_t))
28
28
29
29
CPACF_QUERY (km , KM );
30
30
CPACF_QUERY (kmc , KMC );
@@ -40,20 +40,20 @@ CPACF_QUERY(prno, PRNO);
40
40
CPACF_QUERY (kma , KMA );
41
41
CPACF_QUERY (kdsa , KDSA );
42
42
43
- #define CPACF_QAI (name , instruction ) \
44
- static ssize_t name##_query_auth_info_raw_read( \
45
- struct file *fp, struct kobject *kobj, \
46
- struct bin_attribute *attr, char *buf, loff_t offs, \
47
- size_t count) \
48
- { \
49
- cpacf_qai_t qai; \
50
- \
51
- if (!cpacf_qai(CPACF_##instruction, &qai)) \
52
- return -EOPNOTSUPP; \
53
- return memory_read_from_buffer(buf, count, &offs, &qai, \
54
- sizeof(qai)); \
55
- } \
56
- static BIN_ATTR_RO(name##_query_auth_info_raw, sizeof(cpacf_qai_t))
43
+ #define CPACF_QAI (name , instruction ) \
44
+ static ssize_t name##_query_auth_info_raw_read( \
45
+ struct file *fp, struct kobject *kobj, \
46
+ const struct bin_attribute *attr, char *buf, loff_t offs, \
47
+ size_t count) \
48
+ { \
49
+ cpacf_qai_t qai; \
50
+ \
51
+ if (!cpacf_qai(CPACF_##instruction, &qai)) \
52
+ return -EOPNOTSUPP; \
53
+ return memory_read_from_buffer(buf, count, &offs, &qai, \
54
+ sizeof(qai)); \
55
+ } \
56
+ static const BIN_ATTR_RO(name##_query_auth_info_raw, sizeof(cpacf_qai_t))
57
57
58
58
CPACF_QAI (km , KM );
59
59
CPACF_QAI (kmc , KMC );
@@ -69,7 +69,7 @@ CPACF_QAI(prno, PRNO);
69
69
CPACF_QAI (kma , KMA );
70
70
CPACF_QAI (kdsa , KDSA );
71
71
72
- static struct bin_attribute * cpacf_attrs [] = {
72
+ static const struct bin_attribute * const cpacf_attrs [] = {
73
73
& bin_attr_km_query_raw ,
74
74
& bin_attr_kmc_query_raw ,
75
75
& bin_attr_kimd_query_raw ,
@@ -101,7 +101,7 @@ static struct bin_attribute *cpacf_attrs[] = {
101
101
102
102
static const struct attribute_group cpacf_attr_grp = {
103
103
.name = "cpacf" ,
104
- .bin_attrs = cpacf_attrs ,
104
+ .bin_attrs_new = cpacf_attrs ,
105
105
};
106
106
107
107
static int __init cpacf_init (void )
0 commit comments