@@ -135,7 +135,7 @@ struct ref_scale_ops {
135
135
const char * name ;
136
136
};
137
137
138
- static struct ref_scale_ops * cur_ops ;
138
+ static const struct ref_scale_ops * cur_ops ;
139
139
140
140
static void un_delay (const int udl , const int ndl )
141
141
{
@@ -171,7 +171,7 @@ static bool rcu_sync_scale_init(void)
171
171
return true;
172
172
}
173
173
174
- static struct ref_scale_ops rcu_ops = {
174
+ static const struct ref_scale_ops rcu_ops = {
175
175
.init = rcu_sync_scale_init ,
176
176
.readsection = ref_rcu_read_section ,
177
177
.delaysection = ref_rcu_delay_section ,
@@ -205,7 +205,7 @@ static void srcu_ref_scale_delay_section(const int nloops, const int udl, const
205
205
}
206
206
}
207
207
208
- static struct ref_scale_ops srcu_ops = {
208
+ static const struct ref_scale_ops srcu_ops = {
209
209
.init = rcu_sync_scale_init ,
210
210
.readsection = srcu_ref_scale_read_section ,
211
211
.delaysection = srcu_ref_scale_delay_section ,
@@ -232,7 +232,7 @@ static void rcu_tasks_ref_scale_delay_section(const int nloops, const int udl, c
232
232
un_delay (udl , ndl );
233
233
}
234
234
235
- static struct ref_scale_ops rcu_tasks_ops = {
235
+ static const struct ref_scale_ops rcu_tasks_ops = {
236
236
.init = rcu_sync_scale_init ,
237
237
.readsection = rcu_tasks_ref_scale_read_section ,
238
238
.delaysection = rcu_tasks_ref_scale_delay_section ,
@@ -271,7 +271,7 @@ static void rcu_trace_ref_scale_delay_section(const int nloops, const int udl, c
271
271
}
272
272
}
273
273
274
- static struct ref_scale_ops rcu_trace_ops = {
274
+ static const struct ref_scale_ops rcu_trace_ops = {
275
275
.init = rcu_sync_scale_init ,
276
276
.readsection = rcu_trace_ref_scale_read_section ,
277
277
.delaysection = rcu_trace_ref_scale_delay_section ,
@@ -310,7 +310,7 @@ static void ref_refcnt_delay_section(const int nloops, const int udl, const int
310
310
}
311
311
}
312
312
313
- static struct ref_scale_ops refcnt_ops = {
313
+ static const struct ref_scale_ops refcnt_ops = {
314
314
.init = rcu_sync_scale_init ,
315
315
.readsection = ref_refcnt_section ,
316
316
.delaysection = ref_refcnt_delay_section ,
@@ -347,7 +347,7 @@ static void ref_rwlock_delay_section(const int nloops, const int udl, const int
347
347
}
348
348
}
349
349
350
- static struct ref_scale_ops rwlock_ops = {
350
+ static const struct ref_scale_ops rwlock_ops = {
351
351
.init = ref_rwlock_init ,
352
352
.readsection = ref_rwlock_section ,
353
353
.delaysection = ref_rwlock_delay_section ,
@@ -384,7 +384,7 @@ static void ref_rwsem_delay_section(const int nloops, const int udl, const int n
384
384
}
385
385
}
386
386
387
- static struct ref_scale_ops rwsem_ops = {
387
+ static const struct ref_scale_ops rwsem_ops = {
388
388
.init = ref_rwsem_init ,
389
389
.readsection = ref_rwsem_section ,
390
390
.delaysection = ref_rwsem_delay_section ,
@@ -419,7 +419,7 @@ static void ref_lock_delay_section(const int nloops, const int udl, const int nd
419
419
preempt_enable ();
420
420
}
421
421
422
- static struct ref_scale_ops lock_ops = {
422
+ static const struct ref_scale_ops lock_ops = {
423
423
.readsection = ref_lock_section ,
424
424
.delaysection = ref_lock_delay_section ,
425
425
.name = "lock"
@@ -454,7 +454,7 @@ static void ref_lock_irq_delay_section(const int nloops, const int udl, const in
454
454
preempt_enable ();
455
455
}
456
456
457
- static struct ref_scale_ops lock_irq_ops = {
457
+ static const struct ref_scale_ops lock_irq_ops = {
458
458
.readsection = ref_lock_irq_section ,
459
459
.delaysection = ref_lock_irq_delay_section ,
460
460
.name = "lock-irq"
@@ -490,7 +490,7 @@ static void ref_acqrel_delay_section(const int nloops, const int udl, const int
490
490
preempt_enable ();
491
491
}
492
492
493
- static struct ref_scale_ops acqrel_ops = {
493
+ static const struct ref_scale_ops acqrel_ops = {
494
494
.readsection = ref_acqrel_section ,
495
495
.delaysection = ref_acqrel_delay_section ,
496
496
.name = "acqrel"
@@ -524,7 +524,7 @@ static void ref_clock_delay_section(const int nloops, const int udl, const int n
524
524
stopopts = x ;
525
525
}
526
526
527
- static struct ref_scale_ops clock_ops = {
527
+ static const struct ref_scale_ops clock_ops = {
528
528
.readsection = ref_clock_section ,
529
529
.delaysection = ref_clock_delay_section ,
530
530
.name = "clock"
@@ -556,7 +556,7 @@ static void ref_jiffies_delay_section(const int nloops, const int udl, const int
556
556
stopopts = x ;
557
557
}
558
558
559
- static struct ref_scale_ops jiffies_ops = {
559
+ static const struct ref_scale_ops jiffies_ops = {
560
560
.readsection = ref_jiffies_section ,
561
561
.delaysection = ref_jiffies_delay_section ,
562
562
.name = "jiffies"
@@ -706,9 +706,9 @@ static void refscale_typesafe_ctor(void *rtsp_in)
706
706
preempt_enable ();
707
707
}
708
708
709
- static struct ref_scale_ops typesafe_ref_ops ;
710
- static struct ref_scale_ops typesafe_lock_ops ;
711
- static struct ref_scale_ops typesafe_seqlock_ops ;
709
+ static const struct ref_scale_ops typesafe_ref_ops ;
710
+ static const struct ref_scale_ops typesafe_lock_ops ;
711
+ static const struct ref_scale_ops typesafe_seqlock_ops ;
712
712
713
713
// Initialize for a typesafe test.
714
714
static bool typesafe_init (void )
@@ -769,23 +769,23 @@ static void typesafe_cleanup(void)
769
769
}
770
770
771
771
// The typesafe_init() function distinguishes these structures by address.
772
- static struct ref_scale_ops typesafe_ref_ops = {
772
+ static const struct ref_scale_ops typesafe_ref_ops = {
773
773
.init = typesafe_init ,
774
774
.cleanup = typesafe_cleanup ,
775
775
.readsection = typesafe_read_section ,
776
776
.delaysection = typesafe_delay_section ,
777
777
.name = "typesafe_ref"
778
778
};
779
779
780
- static struct ref_scale_ops typesafe_lock_ops = {
780
+ static const struct ref_scale_ops typesafe_lock_ops = {
781
781
.init = typesafe_init ,
782
782
.cleanup = typesafe_cleanup ,
783
783
.readsection = typesafe_read_section ,
784
784
.delaysection = typesafe_delay_section ,
785
785
.name = "typesafe_lock"
786
786
};
787
787
788
- static struct ref_scale_ops typesafe_seqlock_ops = {
788
+ static const struct ref_scale_ops typesafe_seqlock_ops = {
789
789
.init = typesafe_init ,
790
790
.cleanup = typesafe_cleanup ,
791
791
.readsection = typesafe_read_section ,
@@ -1026,7 +1026,7 @@ static int main_func(void *arg)
1026
1026
}
1027
1027
1028
1028
static void
1029
- ref_scale_print_module_parms (struct ref_scale_ops * cur_ops , const char * tag )
1029
+ ref_scale_print_module_parms (const struct ref_scale_ops * cur_ops , const char * tag )
1030
1030
{
1031
1031
pr_alert ("%s" SCALE_FLAG
1032
1032
"--- %s: verbose=%d verbose_batched=%d shutdown=%d holdoff=%d lookup_instances=%ld loops=%ld nreaders=%d nruns=%d readdelay=%d\n" , scale_type , tag ,
@@ -1081,7 +1081,7 @@ ref_scale_init(void)
1081
1081
{
1082
1082
long i ;
1083
1083
int firsterr = 0 ;
1084
- static struct ref_scale_ops * scale_ops [] = {
1084
+ static const struct ref_scale_ops * scale_ops [] = {
1085
1085
& rcu_ops , & srcu_ops , RCU_TRACE_OPS RCU_TASKS_OPS & refcnt_ops , & rwlock_ops ,
1086
1086
& rwsem_ops , & lock_ops , & lock_irq_ops , & acqrel_ops , & clock_ops , & jiffies_ops ,
1087
1087
& typesafe_ref_ops , & typesafe_lock_ops , & typesafe_seqlock_ops ,
0 commit comments