The dca_ops structure is never modified, so declare it as const. Done with the help of Coccinelle.
Showing the changes to drivers (2 of 3 files). Show all
Unified · Split
| @@ -321,7 +321,8 @@ EXPORT_SYMBOL_GPL(dca_get_tag); · 320 unmodified lines | |||
| 321 | * @ops - pointer to struct of dca operation function pointers | 321 | * @ops - pointer to struct of dca operation function pointers |
| 322 | * @priv_size - size of extra mem to be added for provider's needs | 322 | * @priv_size - size of extra mem to be added for provider's needs |
| 323 | */ | 323 | */ |
| 324 | struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size) | 324 | struct dca_provider *alloc_dca_provider(const struct dca_ops *ops, |
| 325 | int priv_size) | ||
| 325 | { | 326 | { |
| 326 | struct dca_provider *dca; | 327 | struct dca_provider *dca; |
| 327 | int alloc_size; | 328 | int alloc_size; |
| @@ -224,7 +224,7 @@ static u8 ioat_dca_get_tag(struct dca_provider *dca, · 223 unmodified lines | |||
| 224 | return tag; | 224 | return tag; |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | static struct dca_ops ioat_dca_ops = { | 227 | static const struct dca_ops ioat_dca_ops = { |
| 228 | .add_requester = ioat_dca_add_requester, | 228 | .add_requester = ioat_dca_add_requester, |
| 229 | .remove_requester = ioat_dca_remove_requester, | 229 | .remove_requester = ioat_dca_remove_requester, |
| 230 | .get_tag = ioat_dca_get_tag, | 230 | .get_tag = ioat_dca_get_tag, |