]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[XFRM]: constify 'struct xfrm_type'
authorEric Dumazet <dada1@cosmosbay.com>
Thu, 31 Jan 2008 03:11:50 +0000 (19:11 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2008 03:27:20 +0000 (19:27 -0800)
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/ipv4/ah4.c
net/ipv4/esp4.c
net/ipv4/ipcomp.c
net/ipv4/xfrm4_tunnel.c
net/ipv6/ah6.c
net/ipv6/esp6.c
net/ipv6/ipcomp6.c
net/ipv6/mip6.c
net/ipv6/xfrm6_tunnel.c
net/xfrm/xfrm_state.c

index 34d373775a0ee06ce105eb41efd6b29005a586ab..ac72116636ca7f46bfb486079fd244d7b5433f9f 100644 (file)
@@ -202,7 +202,7 @@ struct xfrm_state
 
        /* Reference to data common to all the instances of this
         * transformer. */
-       struct xfrm_type        *type;
+       const struct xfrm_type  *type;
        struct xfrm_mode        *inner_mode;
        struct xfrm_mode        *outer_mode;
 
@@ -279,7 +279,7 @@ struct xfrm_state_afinfo {
        unsigned int            proto;
        unsigned int            eth_proto;
        struct module           *owner;
-       struct xfrm_type        *type_map[IPPROTO_MAX];
+       const struct xfrm_type  *type_map[IPPROTO_MAX];
        struct xfrm_mode        *mode_map[XFRM_MODE_MAX];
        int                     (*init_flags)(struct xfrm_state *x);
        void                    (*init_tempsel)(struct xfrm_state *x, struct flowi *fl,
@@ -322,8 +322,8 @@ struct xfrm_type
        u32                     (*get_mtu)(struct xfrm_state *, int size);
 };
 
-extern int xfrm_register_type(struct xfrm_type *type, unsigned short family);
-extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family);
+extern int xfrm_register_type(const struct xfrm_type *type, unsigned short family);
+extern int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family);
 
 struct xfrm_mode {
        /*
index d76803a3dcae843f1ebf07794fdd0da6c34b9498..9d4555ec0b59136eb4e1ba259531c5d57cd7d451 100644 (file)
@@ -300,7 +300,7 @@ static void ah_destroy(struct xfrm_state *x)
 }
 
 
-static struct xfrm_type ah_type =
+static const struct xfrm_type ah_type =
 {
        .description    = "AH4",
        .owner          = THIS_MODULE,
index fac4f102c9f977b794c9db94d359463738a0e902..258d17631b4bb9b1767b8a8afa8582250f046a3a 100644 (file)
@@ -600,7 +600,7 @@ error:
        return err;
 }
 
-static struct xfrm_type esp_type =
+static const struct xfrm_type esp_type =
 {
        .description    = "ESP4",
        .owner          = THIS_MODULE,
index b79cdbee68a98460edef55d6c957c0e9d66aef25..ae1f45fc23b966869eb7a3b0bf1dbb06712cd7c8 100644 (file)
@@ -437,7 +437,7 @@ error:
        goto out;
 }
 
-static struct xfrm_type ipcomp_type = {
+static const struct xfrm_type ipcomp_type = {
        .description    = "IPCOMP4",
        .owner          = THIS_MODULE,
        .proto          = IPPROTO_COMP,
index 326845195620dd07851907fdf03d65cadb0be220..87f77e412ba26533e0f03a3d2339cb637041cdb7 100644 (file)
@@ -38,7 +38,7 @@ static void ipip_destroy(struct xfrm_state *x)
 {
 }
 
-static struct xfrm_type ipip_type = {
+static const struct xfrm_type ipip_type = {
        .description    = "IPIP",
        .owner          = THIS_MODULE,
        .proto          = IPPROTO_IPIP,
index fb0d07a15e934678c8c91fbfa5bcf0be5718a50a..379c8e04c36c6ccf17e84abf860fd734fb5945be 100644 (file)
@@ -515,7 +515,7 @@ static void ah6_destroy(struct xfrm_state *x)
        kfree(ahp);
 }
 
-static struct xfrm_type ah6_type =
+static const struct xfrm_type ah6_type =
 {
        .description    = "AH6",
        .owner          = THIS_MODULE,
index ca48c56c4b1717f7793099a0273b8e001aa25b40..8e0f1428c7167ac85dbdc0b5e4a33426e9e44a5d 100644 (file)
@@ -538,7 +538,7 @@ error:
        return err;
 }
 
-static struct xfrm_type esp6_type =
+static const struct xfrm_type esp6_type =
 {
        .description    = "ESP6",
        .owner          = THIS_MODULE,
index 710325e7a84246a4f09d6c2da5af562260c1b32e..b90039593a7f0873c0d8af1b7c67144a2a34f531 100644 (file)
@@ -453,7 +453,7 @@ error:
        goto out;
 }
 
-static struct xfrm_type ipcomp6_type =
+static const struct xfrm_type ipcomp6_type =
 {
        .description    = "IPCOMP6",
        .owner          = THIS_MODULE,
index 49d396620eac97e42d6c4602ac178d3cdfd9f1b8..cd8a5bda13cd7a5caad4ac6c8280764e123cb7d7 100644 (file)
@@ -330,7 +330,7 @@ static void mip6_destopt_destroy(struct xfrm_state *x)
 {
 }
 
-static struct xfrm_type mip6_destopt_type =
+static const struct xfrm_type mip6_destopt_type =
 {
        .description    = "MIP6DESTOPT",
        .owner          = THIS_MODULE,
@@ -462,7 +462,7 @@ static void mip6_rthdr_destroy(struct xfrm_state *x)
 {
 }
 
-static struct xfrm_type mip6_rthdr_type =
+static const struct xfrm_type mip6_rthdr_type =
 {
        .description    = "MIP6RT",
        .owner          = THIS_MODULE,
index fae90ff310875eac20da4de63c56469ce53237eb..639fe8a6ff1e996c9bcec6c36cb7e70b88d63be8 100644 (file)
@@ -319,7 +319,7 @@ static void xfrm6_tunnel_destroy(struct xfrm_state *x)
        xfrm6_tunnel_free_spi((xfrm_address_t *)&x->props.saddr);
 }
 
-static struct xfrm_type xfrm6_tunnel_type = {
+static const struct xfrm_type xfrm6_tunnel_type = {
        .description    = "IP6IP6",
        .owner          = THIS_MODULE,
        .proto          = IPPROTO_IPV6,
index 3003503d0c94937d570795fcbabf8ce155155130..4463eeb8d1de86016737ff2802adb21eaac18343 100644 (file)
@@ -216,10 +216,10 @@ static void xfrm_state_unlock_afinfo(struct xfrm_state_afinfo *afinfo)
        write_unlock_bh(&xfrm_state_afinfo_lock);
 }
 
-int xfrm_register_type(struct xfrm_type *type, unsigned short family)
+int xfrm_register_type(const struct xfrm_type *type, unsigned short family)
 {
        struct xfrm_state_afinfo *afinfo = xfrm_state_lock_afinfo(family);
-       struct xfrm_type **typemap;
+       const struct xfrm_type **typemap;
        int err = 0;
 
        if (unlikely(afinfo == NULL))
@@ -235,10 +235,10 @@ int xfrm_register_type(struct xfrm_type *type, unsigned short family)
 }
 EXPORT_SYMBOL(xfrm_register_type);
 
-int xfrm_unregister_type(struct xfrm_type *type, unsigned short family)
+int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family)
 {
        struct xfrm_state_afinfo *afinfo = xfrm_state_lock_afinfo(family);
-       struct xfrm_type **typemap;
+       const struct xfrm_type **typemap;
        int err = 0;
 
        if (unlikely(afinfo == NULL))
@@ -254,11 +254,11 @@ int xfrm_unregister_type(struct xfrm_type *type, unsigned short family)
 }
 EXPORT_SYMBOL(xfrm_unregister_type);
 
-static struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family)
+static const struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family)
 {
        struct xfrm_state_afinfo *afinfo;
-       struct xfrm_type **typemap;
-       struct xfrm_type *type;
+       const struct xfrm_type **typemap;
+       const struct xfrm_type *type;
        int modload_attempted = 0;
 
 retry:
@@ -281,7 +281,7 @@ retry:
        return type;
 }
 
-static void xfrm_put_type(struct xfrm_type *type)
+static void xfrm_put_type(const struct xfrm_type *type)
 {
        module_put(type->owner);
 }