1414#define CPACF_QUERY (name , instruction ) \
1515static ssize_t name##_query_raw_read(struct file *fp, \
1616 struct kobject *kobj, \
17- struct bin_attribute *attr, \
17+ const struct bin_attribute *attr, \
1818 char *buf, loff_t offs, \
1919 size_t count) \
2020{ \
@@ -24,7 +24,7 @@ static ssize_t name##_query_raw_read(struct file *fp, \
2424 return -EOPNOTSUPP; \
2525 return memory_read_from_buffer(buf, count, &offs, &mask, sizeof(mask)); \
2626} \
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))
2828
2929CPACF_QUERY (km , KM );
3030CPACF_QUERY (kmc , KMC );
@@ -40,20 +40,20 @@ CPACF_QUERY(prno, PRNO);
4040CPACF_QUERY (kma , KMA );
4141CPACF_QUERY (kdsa , KDSA );
4242
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))
5757
5858CPACF_QAI (km , KM );
5959CPACF_QAI (kmc , KMC );
@@ -69,7 +69,7 @@ CPACF_QAI(prno, PRNO);
6969CPACF_QAI (kma , KMA );
7070CPACF_QAI (kdsa , KDSA );
7171
72- static struct bin_attribute * cpacf_attrs [] = {
72+ static const struct bin_attribute * const cpacf_attrs [] = {
7373 & bin_attr_km_query_raw ,
7474 & bin_attr_kmc_query_raw ,
7575 & bin_attr_kimd_query_raw ,
@@ -101,7 +101,7 @@ static struct bin_attribute *cpacf_attrs[] = {
101101
102102static const struct attribute_group cpacf_attr_grp = {
103103 .name = "cpacf" ,
104- .bin_attrs = cpacf_attrs ,
104+ .bin_attrs_new = cpacf_attrs ,
105105};
106106
107107static int __init cpacf_init (void )
0 commit comments