@@ -184,7 +184,7 @@ static ssize_t pkey_protkey_hmac_attr_read(u32 keytype, char *buf,
184
184
185
185
static ssize_t protkey_aes_128_read (struct file * filp ,
186
186
struct kobject * kobj ,
187
- struct bin_attribute * attr ,
187
+ const struct bin_attribute * attr ,
188
188
char * buf , loff_t off ,
189
189
size_t count )
190
190
{
@@ -194,7 +194,7 @@ static ssize_t protkey_aes_128_read(struct file *filp,
194
194
195
195
static ssize_t protkey_aes_192_read (struct file * filp ,
196
196
struct kobject * kobj ,
197
- struct bin_attribute * attr ,
197
+ const struct bin_attribute * attr ,
198
198
char * buf , loff_t off ,
199
199
size_t count )
200
200
{
@@ -204,7 +204,7 @@ static ssize_t protkey_aes_192_read(struct file *filp,
204
204
205
205
static ssize_t protkey_aes_256_read (struct file * filp ,
206
206
struct kobject * kobj ,
207
- struct bin_attribute * attr ,
207
+ const struct bin_attribute * attr ,
208
208
char * buf , loff_t off ,
209
209
size_t count )
210
210
{
@@ -214,7 +214,7 @@ static ssize_t protkey_aes_256_read(struct file *filp,
214
214
215
215
static ssize_t protkey_aes_128_xts_read (struct file * filp ,
216
216
struct kobject * kobj ,
217
- struct bin_attribute * attr ,
217
+ const struct bin_attribute * attr ,
218
218
char * buf , loff_t off ,
219
219
size_t count )
220
220
{
@@ -224,7 +224,7 @@ static ssize_t protkey_aes_128_xts_read(struct file *filp,
224
224
225
225
static ssize_t protkey_aes_256_xts_read (struct file * filp ,
226
226
struct kobject * kobj ,
227
- struct bin_attribute * attr ,
227
+ const struct bin_attribute * attr ,
228
228
char * buf , loff_t off ,
229
229
size_t count )
230
230
{
@@ -234,7 +234,7 @@ static ssize_t protkey_aes_256_xts_read(struct file *filp,
234
234
235
235
static ssize_t protkey_aes_xts_128_read (struct file * filp ,
236
236
struct kobject * kobj ,
237
- struct bin_attribute * attr ,
237
+ const struct bin_attribute * attr ,
238
238
char * buf , loff_t off ,
239
239
size_t count )
240
240
{
@@ -244,7 +244,7 @@ static ssize_t protkey_aes_xts_128_read(struct file *filp,
244
244
245
245
static ssize_t protkey_aes_xts_256_read (struct file * filp ,
246
246
struct kobject * kobj ,
247
- struct bin_attribute * attr ,
247
+ const struct bin_attribute * attr ,
248
248
char * buf , loff_t off ,
249
249
size_t count )
250
250
{
@@ -254,7 +254,7 @@ static ssize_t protkey_aes_xts_256_read(struct file *filp,
254
254
255
255
static ssize_t protkey_hmac_512_read (struct file * filp ,
256
256
struct kobject * kobj ,
257
- struct bin_attribute * attr ,
257
+ const struct bin_attribute * attr ,
258
258
char * buf , loff_t off ,
259
259
size_t count )
260
260
{
@@ -264,25 +264,25 @@ static ssize_t protkey_hmac_512_read(struct file *filp,
264
264
265
265
static ssize_t protkey_hmac_1024_read (struct file * filp ,
266
266
struct kobject * kobj ,
267
- struct bin_attribute * attr ,
267
+ const struct bin_attribute * attr ,
268
268
char * buf , loff_t off ,
269
269
size_t count )
270
270
{
271
271
return pkey_protkey_hmac_attr_read (PKEY_KEYTYPE_HMAC_1024 ,
272
272
buf , off , count );
273
273
}
274
274
275
- static BIN_ATTR_RO (protkey_aes_128 , sizeof (struct protaeskeytoken ));
276
- static BIN_ATTR_RO (protkey_aes_192 , sizeof (struct protaeskeytoken ));
277
- static BIN_ATTR_RO (protkey_aes_256 , sizeof (struct protaeskeytoken ));
278
- static BIN_ATTR_RO (protkey_aes_128_xts , 2 * sizeof (struct protaeskeytoken ));
279
- static BIN_ATTR_RO (protkey_aes_256_xts , 2 * sizeof (struct protaeskeytoken ));
280
- static BIN_ATTR_RO (protkey_aes_xts_128 , sizeof (struct protkeytoken ) + 64 );
281
- static BIN_ATTR_RO (protkey_aes_xts_256 , sizeof (struct protkeytoken ) + 96 );
282
- static BIN_ATTR_RO (protkey_hmac_512 , sizeof (struct protkeytoken ) + 96 );
283
- static BIN_ATTR_RO (protkey_hmac_1024 , sizeof (struct protkeytoken ) + 160 );
284
-
285
- static struct bin_attribute * protkey_attrs [] = {
275
+ static const BIN_ATTR_RO (protkey_aes_128 , sizeof (struct protaeskeytoken ));
276
+ static const BIN_ATTR_RO (protkey_aes_192 , sizeof (struct protaeskeytoken ));
277
+ static const BIN_ATTR_RO (protkey_aes_256 , sizeof (struct protaeskeytoken ));
278
+ static const BIN_ATTR_RO (protkey_aes_128_xts , 2 * sizeof (struct protaeskeytoken ));
279
+ static const BIN_ATTR_RO (protkey_aes_256_xts , 2 * sizeof (struct protaeskeytoken ));
280
+ static const BIN_ATTR_RO (protkey_aes_xts_128 , sizeof (struct protkeytoken ) + 64 );
281
+ static const BIN_ATTR_RO (protkey_aes_xts_256 , sizeof (struct protkeytoken ) + 96 );
282
+ static const BIN_ATTR_RO (protkey_hmac_512 , sizeof (struct protkeytoken ) + 96 );
283
+ static const BIN_ATTR_RO (protkey_hmac_1024 , sizeof (struct protkeytoken ) + 160 );
284
+
285
+ static const struct bin_attribute * const protkey_attrs [] = {
286
286
& bin_attr_protkey_aes_128 ,
287
287
& bin_attr_protkey_aes_192 ,
288
288
& bin_attr_protkey_aes_256 ,
@@ -295,9 +295,9 @@ static struct bin_attribute *protkey_attrs[] = {
295
295
NULL
296
296
};
297
297
298
- static struct attribute_group protkey_attr_group = {
299
- .name = "protkey" ,
300
- .bin_attrs = protkey_attrs ,
298
+ static const struct attribute_group protkey_attr_group = {
299
+ .name = "protkey" ,
300
+ .bin_attrs_new = protkey_attrs ,
301
301
};
302
302
303
303
/*
@@ -341,7 +341,7 @@ static ssize_t pkey_ccadata_aes_attr_read(u32 keytype, bool is_xts, char *buf,
341
341
342
342
static ssize_t ccadata_aes_128_read (struct file * filp ,
343
343
struct kobject * kobj ,
344
- struct bin_attribute * attr ,
344
+ const struct bin_attribute * attr ,
345
345
char * buf , loff_t off ,
346
346
size_t count )
347
347
{
@@ -351,7 +351,7 @@ static ssize_t ccadata_aes_128_read(struct file *filp,
351
351
352
352
static ssize_t ccadata_aes_192_read (struct file * filp ,
353
353
struct kobject * kobj ,
354
- struct bin_attribute * attr ,
354
+ const struct bin_attribute * attr ,
355
355
char * buf , loff_t off ,
356
356
size_t count )
357
357
{
@@ -361,7 +361,7 @@ static ssize_t ccadata_aes_192_read(struct file *filp,
361
361
362
362
static ssize_t ccadata_aes_256_read (struct file * filp ,
363
363
struct kobject * kobj ,
364
- struct bin_attribute * attr ,
364
+ const struct bin_attribute * attr ,
365
365
char * buf , loff_t off ,
366
366
size_t count )
367
367
{
@@ -371,7 +371,7 @@ static ssize_t ccadata_aes_256_read(struct file *filp,
371
371
372
372
static ssize_t ccadata_aes_128_xts_read (struct file * filp ,
373
373
struct kobject * kobj ,
374
- struct bin_attribute * attr ,
374
+ const struct bin_attribute * attr ,
375
375
char * buf , loff_t off ,
376
376
size_t count )
377
377
{
@@ -381,21 +381,21 @@ static ssize_t ccadata_aes_128_xts_read(struct file *filp,
381
381
382
382
static ssize_t ccadata_aes_256_xts_read (struct file * filp ,
383
383
struct kobject * kobj ,
384
- struct bin_attribute * attr ,
384
+ const struct bin_attribute * attr ,
385
385
char * buf , loff_t off ,
386
386
size_t count )
387
387
{
388
388
return pkey_ccadata_aes_attr_read (PKEY_KEYTYPE_AES_256 , true, buf ,
389
389
off , count );
390
390
}
391
391
392
- static BIN_ATTR_RO (ccadata_aes_128 , sizeof (struct secaeskeytoken ));
393
- static BIN_ATTR_RO (ccadata_aes_192 , sizeof (struct secaeskeytoken ));
394
- static BIN_ATTR_RO (ccadata_aes_256 , sizeof (struct secaeskeytoken ));
395
- static BIN_ATTR_RO (ccadata_aes_128_xts , 2 * sizeof (struct secaeskeytoken ));
396
- static BIN_ATTR_RO (ccadata_aes_256_xts , 2 * sizeof (struct secaeskeytoken ));
392
+ static const BIN_ATTR_RO (ccadata_aes_128 , sizeof (struct secaeskeytoken ));
393
+ static const BIN_ATTR_RO (ccadata_aes_192 , sizeof (struct secaeskeytoken ));
394
+ static const BIN_ATTR_RO (ccadata_aes_256 , sizeof (struct secaeskeytoken ));
395
+ static const BIN_ATTR_RO (ccadata_aes_128_xts , 2 * sizeof (struct secaeskeytoken ));
396
+ static const BIN_ATTR_RO (ccadata_aes_256_xts , 2 * sizeof (struct secaeskeytoken ));
397
397
398
- static struct bin_attribute * ccadata_attrs [] = {
398
+ static const struct bin_attribute * const ccadata_attrs [] = {
399
399
& bin_attr_ccadata_aes_128 ,
400
400
& bin_attr_ccadata_aes_192 ,
401
401
& bin_attr_ccadata_aes_256 ,
@@ -404,9 +404,9 @@ static struct bin_attribute *ccadata_attrs[] = {
404
404
NULL
405
405
};
406
406
407
- static struct attribute_group ccadata_attr_group = {
408
- .name = "ccadata" ,
409
- .bin_attrs = ccadata_attrs ,
407
+ static const struct attribute_group ccadata_attr_group = {
408
+ .name = "ccadata" ,
409
+ .bin_attrs_new = ccadata_attrs ,
410
410
};
411
411
412
412
#define CCACIPHERTOKENSIZE (sizeof(struct cipherkeytoken) + 80)
@@ -455,7 +455,7 @@ static ssize_t pkey_ccacipher_aes_attr_read(enum pkey_key_size keybits,
455
455
456
456
static ssize_t ccacipher_aes_128_read (struct file * filp ,
457
457
struct kobject * kobj ,
458
- struct bin_attribute * attr ,
458
+ const struct bin_attribute * attr ,
459
459
char * buf , loff_t off ,
460
460
size_t count )
461
461
{
@@ -465,7 +465,7 @@ static ssize_t ccacipher_aes_128_read(struct file *filp,
465
465
466
466
static ssize_t ccacipher_aes_192_read (struct file * filp ,
467
467
struct kobject * kobj ,
468
- struct bin_attribute * attr ,
468
+ const struct bin_attribute * attr ,
469
469
char * buf , loff_t off ,
470
470
size_t count )
471
471
{
@@ -475,7 +475,7 @@ static ssize_t ccacipher_aes_192_read(struct file *filp,
475
475
476
476
static ssize_t ccacipher_aes_256_read (struct file * filp ,
477
477
struct kobject * kobj ,
478
- struct bin_attribute * attr ,
478
+ const struct bin_attribute * attr ,
479
479
char * buf , loff_t off ,
480
480
size_t count )
481
481
{
@@ -485,7 +485,7 @@ static ssize_t ccacipher_aes_256_read(struct file *filp,
485
485
486
486
static ssize_t ccacipher_aes_128_xts_read (struct file * filp ,
487
487
struct kobject * kobj ,
488
- struct bin_attribute * attr ,
488
+ const struct bin_attribute * attr ,
489
489
char * buf , loff_t off ,
490
490
size_t count )
491
491
{
@@ -495,21 +495,21 @@ static ssize_t ccacipher_aes_128_xts_read(struct file *filp,
495
495
496
496
static ssize_t ccacipher_aes_256_xts_read (struct file * filp ,
497
497
struct kobject * kobj ,
498
- struct bin_attribute * attr ,
498
+ const struct bin_attribute * attr ,
499
499
char * buf , loff_t off ,
500
500
size_t count )
501
501
{
502
502
return pkey_ccacipher_aes_attr_read (PKEY_SIZE_AES_256 , true, buf ,
503
503
off , count );
504
504
}
505
505
506
- static BIN_ATTR_RO (ccacipher_aes_128 , CCACIPHERTOKENSIZE ) ;
507
- static BIN_ATTR_RO (ccacipher_aes_192 , CCACIPHERTOKENSIZE ) ;
508
- static BIN_ATTR_RO (ccacipher_aes_256 , CCACIPHERTOKENSIZE ) ;
509
- static BIN_ATTR_RO (ccacipher_aes_128_xts , 2 * CCACIPHERTOKENSIZE ) ;
510
- static BIN_ATTR_RO (ccacipher_aes_256_xts , 2 * CCACIPHERTOKENSIZE ) ;
506
+ static const BIN_ATTR_RO (ccacipher_aes_128 , CCACIPHERTOKENSIZE ) ;
507
+ static const BIN_ATTR_RO (ccacipher_aes_192 , CCACIPHERTOKENSIZE ) ;
508
+ static const BIN_ATTR_RO (ccacipher_aes_256 , CCACIPHERTOKENSIZE ) ;
509
+ static const BIN_ATTR_RO (ccacipher_aes_128_xts , 2 * CCACIPHERTOKENSIZE ) ;
510
+ static const BIN_ATTR_RO (ccacipher_aes_256_xts , 2 * CCACIPHERTOKENSIZE ) ;
511
511
512
- static struct bin_attribute * ccacipher_attrs [] = {
512
+ static const struct bin_attribute * const ccacipher_attrs [] = {
513
513
& bin_attr_ccacipher_aes_128 ,
514
514
& bin_attr_ccacipher_aes_192 ,
515
515
& bin_attr_ccacipher_aes_256 ,
@@ -518,9 +518,9 @@ static struct bin_attribute *ccacipher_attrs[] = {
518
518
NULL
519
519
};
520
520
521
- static struct attribute_group ccacipher_attr_group = {
522
- .name = "ccacipher" ,
523
- .bin_attrs = ccacipher_attrs ,
521
+ static const struct attribute_group ccacipher_attr_group = {
522
+ .name = "ccacipher" ,
523
+ .bin_attrs_new = ccacipher_attrs ,
524
524
};
525
525
526
526
/*
@@ -570,7 +570,7 @@ static ssize_t pkey_ep11_aes_attr_read(enum pkey_key_size keybits,
570
570
571
571
static ssize_t ep11_aes_128_read (struct file * filp ,
572
572
struct kobject * kobj ,
573
- struct bin_attribute * attr ,
573
+ const struct bin_attribute * attr ,
574
574
char * buf , loff_t off ,
575
575
size_t count )
576
576
{
@@ -580,7 +580,7 @@ static ssize_t ep11_aes_128_read(struct file *filp,
580
580
581
581
static ssize_t ep11_aes_192_read (struct file * filp ,
582
582
struct kobject * kobj ,
583
- struct bin_attribute * attr ,
583
+ const struct bin_attribute * attr ,
584
584
char * buf , loff_t off ,
585
585
size_t count )
586
586
{
@@ -590,7 +590,7 @@ static ssize_t ep11_aes_192_read(struct file *filp,
590
590
591
591
static ssize_t ep11_aes_256_read (struct file * filp ,
592
592
struct kobject * kobj ,
593
- struct bin_attribute * attr ,
593
+ const struct bin_attribute * attr ,
594
594
char * buf , loff_t off ,
595
595
size_t count )
596
596
{
@@ -600,7 +600,7 @@ static ssize_t ep11_aes_256_read(struct file *filp,
600
600
601
601
static ssize_t ep11_aes_128_xts_read (struct file * filp ,
602
602
struct kobject * kobj ,
603
- struct bin_attribute * attr ,
603
+ const struct bin_attribute * attr ,
604
604
char * buf , loff_t off ,
605
605
size_t count )
606
606
{
@@ -610,21 +610,21 @@ static ssize_t ep11_aes_128_xts_read(struct file *filp,
610
610
611
611
static ssize_t ep11_aes_256_xts_read (struct file * filp ,
612
612
struct kobject * kobj ,
613
- struct bin_attribute * attr ,
613
+ const struct bin_attribute * attr ,
614
614
char * buf , loff_t off ,
615
615
size_t count )
616
616
{
617
617
return pkey_ep11_aes_attr_read (PKEY_SIZE_AES_256 , true, buf ,
618
618
off , count );
619
619
}
620
620
621
- static BIN_ATTR_RO (ep11_aes_128 , MAXEP11AESKEYBLOBSIZE ) ;
622
- static BIN_ATTR_RO (ep11_aes_192 , MAXEP11AESKEYBLOBSIZE ) ;
623
- static BIN_ATTR_RO (ep11_aes_256 , MAXEP11AESKEYBLOBSIZE ) ;
624
- static BIN_ATTR_RO (ep11_aes_128_xts , 2 * MAXEP11AESKEYBLOBSIZE ) ;
625
- static BIN_ATTR_RO (ep11_aes_256_xts , 2 * MAXEP11AESKEYBLOBSIZE ) ;
621
+ static const BIN_ATTR_RO (ep11_aes_128 , MAXEP11AESKEYBLOBSIZE ) ;
622
+ static const BIN_ATTR_RO (ep11_aes_192 , MAXEP11AESKEYBLOBSIZE ) ;
623
+ static const BIN_ATTR_RO (ep11_aes_256 , MAXEP11AESKEYBLOBSIZE ) ;
624
+ static const BIN_ATTR_RO (ep11_aes_128_xts , 2 * MAXEP11AESKEYBLOBSIZE ) ;
625
+ static const BIN_ATTR_RO (ep11_aes_256_xts , 2 * MAXEP11AESKEYBLOBSIZE ) ;
626
626
627
- static struct bin_attribute * ep11_attrs [] = {
627
+ static const struct bin_attribute * const ep11_attrs [] = {
628
628
& bin_attr_ep11_aes_128 ,
629
629
& bin_attr_ep11_aes_192 ,
630
630
& bin_attr_ep11_aes_256 ,
@@ -633,9 +633,9 @@ static struct bin_attribute *ep11_attrs[] = {
633
633
NULL
634
634
};
635
635
636
- static struct attribute_group ep11_attr_group = {
636
+ static const struct attribute_group ep11_attr_group = {
637
637
.name = "ep11" ,
638
- .bin_attrs = ep11_attrs ,
638
+ .bin_attrs_new = ep11_attrs ,
639
639
};
640
640
641
641
const struct attribute_group * pkey_attr_groups [] = {
0 commit comments