@@ -655,7 +655,7 @@ static const struct attribute_group wireless_group = {
655
655
static ssize_t rx_queue_attr_show (struct kobject * kobj , struct attribute * attr ,
656
656
char * buf )
657
657
{
658
- struct rx_queue_attribute * attribute = to_rx_queue_attr (attr );
658
+ const struct rx_queue_attribute * attribute = to_rx_queue_attr (attr );
659
659
struct netdev_rx_queue * queue = to_rx_queue (kobj );
660
660
661
661
if (!attribute -> show )
@@ -667,7 +667,7 @@ static ssize_t rx_queue_attr_show(struct kobject *kobj, struct attribute *attr,
667
667
static ssize_t rx_queue_attr_store (struct kobject * kobj , struct attribute * attr ,
668
668
const char * buf , size_t count )
669
669
{
670
- struct rx_queue_attribute * attribute = to_rx_queue_attr (attr );
670
+ const struct rx_queue_attribute * attribute = to_rx_queue_attr (attr );
671
671
struct netdev_rx_queue * queue = to_rx_queue (kobj );
672
672
673
673
if (!attribute -> store )
@@ -842,16 +842,15 @@ static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue,
842
842
return len ;
843
843
}
844
844
845
- static struct rx_queue_attribute rps_cpus_attribute =
846
- __ATTR (rps_cpus , S_IRUGO | S_IWUSR , show_rps_map , store_rps_map );
845
+ static struct rx_queue_attribute rps_cpus_attribute __ro_after_init
846
+ = __ATTR (rps_cpus , S_IRUGO | S_IWUSR , show_rps_map , store_rps_map );
847
847
848
-
849
- static struct rx_queue_attribute rps_dev_flow_table_cnt_attribute =
850
- __ATTR (rps_flow_cnt , S_IRUGO | S_IWUSR ,
851
- show_rps_dev_flow_table_cnt , store_rps_dev_flow_table_cnt );
848
+ static struct rx_queue_attribute rps_dev_flow_table_cnt_attribute __ro_after_init
849
+ = __ATTR (rps_flow_cnt , S_IRUGO | S_IWUSR ,
850
+ show_rps_dev_flow_table_cnt , store_rps_dev_flow_table_cnt );
852
851
#endif /* CONFIG_RPS */
853
852
854
- static struct attribute * rx_queue_default_attrs [] = {
853
+ static struct attribute * rx_queue_default_attrs [] __ro_after_init = {
855
854
#ifdef CONFIG_RPS
856
855
& rps_cpus_attribute .attr ,
857
856
& rps_dev_flow_table_cnt_attribute .attr ,
@@ -896,7 +895,7 @@ static const void *rx_queue_namespace(struct kobject *kobj)
896
895
return ns ;
897
896
}
898
897
899
- static struct kobj_type rx_queue_ktype = {
898
+ static struct kobj_type rx_queue_ktype __ro_after_init = {
900
899
.sysfs_ops = & rx_queue_sysfs_ops ,
901
900
.release = rx_queue_release ,
902
901
.default_attrs = rx_queue_default_attrs ,
@@ -983,7 +982,8 @@ struct netdev_queue_attribute {
983
982
static ssize_t netdev_queue_attr_show (struct kobject * kobj ,
984
983
struct attribute * attr , char * buf )
985
984
{
986
- struct netdev_queue_attribute * attribute = to_netdev_queue_attr (attr );
985
+ const struct netdev_queue_attribute * attribute
986
+ = to_netdev_queue_attr (attr );
987
987
struct netdev_queue * queue = to_netdev_queue (kobj );
988
988
989
989
if (!attribute -> show )
@@ -996,7 +996,8 @@ static ssize_t netdev_queue_attr_store(struct kobject *kobj,
996
996
struct attribute * attr ,
997
997
const char * buf , size_t count )
998
998
{
999
- struct netdev_queue_attribute * attribute = to_netdev_queue_attr (attr );
999
+ const struct netdev_queue_attribute * attribute
1000
+ = to_netdev_queue_attr (attr );
1000
1001
struct netdev_queue * queue = to_netdev_queue (kobj );
1001
1002
1002
1003
if (!attribute -> store )
0 commit comments