dmaengine: ioatdma: constify dca_ops structures
authorJulia Lawall <julia.lawall@lip6.fr>
Fri, 13 Nov 2015 11:46:00 +0000 (12:46 +0100)
committerVinod Koul <vinod.koul@intel.com>
Mon, 16 Nov 2015 03:57:32 +0000 (09:27 +0530)
The dca_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dca/dca-core.c
drivers/dma/ioat/dca.c
include/linux/dca.h

index 819dfda8823623fb8c7741f4ed299626393db044..7afbb28d6a0f9b5de82ec82b5a1a2bf591511443 100644 (file)
@@ -321,7 +321,8 @@ EXPORT_SYMBOL_GPL(dca_get_tag);
  * @ops - pointer to struct of dca operation function pointers
  * @priv_size - size of extra mem to be added for provider's needs
  */
-struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size)
+struct dca_provider *alloc_dca_provider(const struct dca_ops *ops,
+                                       int priv_size)
 {
        struct dca_provider *dca;
        int alloc_size;
index 2cb7c308d5c72afbb0a8aa530a7b5f719b6ace96..0b9b6b07db9e9245bfa30c47a356a28d065c6dfd 100644 (file)
@@ -224,7 +224,7 @@ static u8 ioat_dca_get_tag(struct dca_provider *dca,
        return tag;
 }
 
-static struct dca_ops ioat_dca_ops = {
+static const struct dca_ops ioat_dca_ops = {
        .add_requester          = ioat_dca_add_requester,
        .remove_requester       = ioat_dca_remove_requester,
        .get_tag                = ioat_dca_get_tag,
index d27a7a05718d3d0b299228f7c217d7924f242253..ad956c2e07a86dec7594e4910bbb46581fbbe163 100644 (file)
@@ -34,7 +34,7 @@ void dca_unregister_notify(struct notifier_block *nb);
 
 struct dca_provider {
        struct list_head        node;
-       struct dca_ops          *ops;
+       const struct dca_ops    *ops;
        struct device           *cd;
        int                      id;
 };
@@ -53,7 +53,8 @@ struct dca_ops {
        int     (*dev_managed)      (struct dca_provider *, struct device *);
 };
 
-struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size);
+struct dca_provider *alloc_dca_provider(const struct dca_ops *ops,
+                                       int priv_size);
 void free_dca_provider(struct dca_provider *dca);
 int register_dca_provider(struct dca_provider *dca, struct device *dev);
 void unregister_dca_provider(struct dca_provider *dca, struct device *dev);