The dca_ops structure is never modified, so declare it as const. Done with the help of Coccinelle.
Showing the changes to include (1 of 3 files). Show all
Unified · Split
| @@ -34,7 +34,7 @@ void dca_unregister_notify(struct notifier_block *nb); · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | struct dca_provider { |
| 36 | 36 | struct list_head node; |
| 37 | − struct dca_ops *ops; | |
| 37 | + const struct dca_ops *ops; | |
| 38 | 38 | struct device *cd; |
| 39 | 39 | int id; |
| 40 | 40 | }; |
| @@ -53,7 +53,8 @@ struct dca_ops { · 12 unmodified lines | ||
| 53 | 53 | int (*dev_managed) (struct dca_provider *, struct device *); |
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | −struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size); | |
| 56 | +struct dca_provider *alloc_dca_provider(const struct dca_ops *ops, | |
| 57 | + int priv_size); | |
| 57 | 58 | void free_dca_provider(struct dca_provider *dca); |
| 58 | 59 | int register_dca_provider(struct dca_provider *dca, struct device *dev); |
| 59 | 60 | void unregister_dca_provider(struct dca_provider *dca, struct device *dev); |