net: atm: constify in_cache_ops and eg_cache_ops structures
authorJulia Lawall <julia.lawall@lip6.fr>
Sat, 21 Nov 2015 17:28:05 +0000 (18:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Nov 2015 20:49:29 +0000 (15:49 -0500)
The in_cache_ops and eg_cache_ops structures are never modified, so declare
them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/atm/mpc.h
net/atm/mpoa_caches.c

index 0919a88bbc70e8e0f39c231d89b5f076bb887a40..cfc7b745aa913a451a4790f98e47654e55ffac18 100644 (file)
@@ -21,11 +21,11 @@ struct mpoa_client {
        uint8_t our_ctrl_addr[ATM_ESA_LEN];  /* MPC's control ATM address   */
 
        rwlock_t ingress_lock;
-       struct in_cache_ops *in_ops; /* ingress cache operations            */
+       const struct in_cache_ops *in_ops; /* ingress cache operations      */
        in_cache_entry *in_cache;    /* the ingress cache of this MPC       */
 
        rwlock_t egress_lock;
-       struct eg_cache_ops *eg_ops; /* egress cache operations             */
+       const struct eg_cache_ops *eg_ops; /* egress cache operations       */
        eg_cache_entry *eg_cache;    /* the egress  cache of this MPC       */
 
        uint8_t *mps_macs;           /* array of MPS MAC addresses, >=1     */
index d1b2d9a0314412570f770ce4630ee08e8f5b229c..9e60e74c807d961bf9eab2d439eb6ffa95599007 100644 (file)
@@ -534,7 +534,7 @@ static void eg_destroy_cache(struct mpoa_client *mpc)
 }
 
 
-static struct in_cache_ops ingress_ops = {
+static const struct in_cache_ops ingress_ops = {
        in_cache_add_entry,               /* add_entry       */
        in_cache_get,                     /* get             */
        in_cache_get_with_mask,           /* get_with_mask   */
@@ -548,7 +548,7 @@ static struct in_cache_ops ingress_ops = {
        in_destroy_cache                  /* destroy_cache   */
 };
 
-static struct eg_cache_ops egress_ops = {
+static const struct eg_cache_ops egress_ops = {
        eg_cache_add_entry,               /* add_entry        */
        eg_cache_get_by_cache_id,         /* get_by_cache_id  */
        eg_cache_get_by_tag,              /* get_by_tag       */
This page took 0.027753 seconds and 5 git commands to generate.