OSDN Git Service

drivers: net: xgene: constify xgene_cle_ops structure
authorJulia Lawall <julia.lawall@lip6.fr>
Sun, 1 May 2016 12:36:28 +0000 (14:36 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 May 2016 17:03:05 +0000 (13:03 -0400)
The xgene_cle_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: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene/xgene_enet_cle.c
drivers/net/ethernet/apm/xgene/xgene_enet_cle.h
drivers/net/ethernet/apm/xgene/xgene_enet_main.h

index b212488..6479288 100644 (file)
@@ -729,6 +729,6 @@ static int xgene_enet_cle_init(struct xgene_enet_pdata *pdata)
        return xgene_cle_setup_ptree(pdata, enet_cle);
 }
 
-struct xgene_cle_ops xgene_cle3in_ops = {
+const struct xgene_cle_ops xgene_cle3in_ops = {
        .cle_init = xgene_enet_cle_init,
 };
index 29a17ab..13e829a 100644 (file)
@@ -290,6 +290,6 @@ struct xgene_enet_cle {
        u32 jump_bytes;
 };
 
-extern struct xgene_cle_ops xgene_cle3in_ops;
+extern const struct xgene_cle_ops xgene_cle3in_ops;
 
 #endif /* __XGENE_ENET_CLE_H__ */
index 175d188..0a2887b 100644 (file)
@@ -191,7 +191,7 @@ struct xgene_enet_pdata {
        const struct xgene_mac_ops *mac_ops;
        const struct xgene_port_ops *port_ops;
        struct xgene_ring_ops *ring_ops;
-       struct xgene_cle_ops *cle_ops;
+       const struct xgene_cle_ops *cle_ops;
        struct delayed_work link_work;
        u32 port_id;
        u8 cpu_bufnum;