]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
net: constify some ppp/pptp structs
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 21 Sep 2010 06:43:54 +0000 (06:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Sep 2010 01:04:47 +0000 (18:04 -0700)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pppoe.c
drivers/net/pppox.c
drivers/net/pptp.c
include/linux/if_pppox.h
net/l2tp/l2tp_ppp.c

index c07de359dc074e7abd789826f25728ab065350b3..d72fb0519a2aa674a8757f5146b0df19655d9749 100644 (file)
@@ -1124,7 +1124,7 @@ static const struct proto_ops pppoe_ops = {
        .ioctl          = pppox_ioctl,
 };
 
-static struct pppox_proto pppoe_proto = {
+static const struct pppox_proto pppoe_proto = {
        .create = pppoe_create,
        .ioctl  = pppoe_ioctl,
        .owner  = THIS_MODULE,
index d4191ef9cad14fed8d1cd6c0d284ddb7e51c8163..8c0d170dabcd5ab32685e6e4e0df52533d9f6de5 100644 (file)
@@ -36,9 +36,9 @@
 
 #include <asm/uaccess.h>
 
-static struct pppox_proto *pppox_protos[PX_MAX_PROTO + 1];
+static const struct pppox_proto *pppox_protos[PX_MAX_PROTO + 1];
 
-int register_pppox_proto(int proto_num, struct pppox_proto *pp)
+int register_pppox_proto(int proto_num, const struct pppox_proto *pp)
 {
        if (proto_num < 0 || proto_num > PX_MAX_PROTO)
                return -EINVAL;
index 761f0eced724642cbfa33f0441ca12ea80eef222..ccbc91326bfad5b04cdb279be57b74fd3c0d6247 100644 (file)
@@ -53,7 +53,7 @@ static struct pppox_sock **callid_sock;
 static DEFINE_SPINLOCK(chan_lock);
 
 static struct proto pptp_sk_proto __read_mostly;
-static struct ppp_channel_ops pptp_chan_ops;
+static const struct ppp_channel_ops pptp_chan_ops;
 static const struct proto_ops pptp_ops;
 
 #define PPP_LCP_ECHOREQ 0x09
@@ -628,7 +628,7 @@ static int pptp_ppp_ioctl(struct ppp_channel *chan, unsigned int cmd,
        return err;
 }
 
-static struct ppp_channel_ops pptp_chan_ops = {
+static const struct ppp_channel_ops pptp_chan_ops = {
        .start_xmit = pptp_xmit,
        .ioctl      = pptp_ppp_ioctl,
 };
@@ -659,12 +659,12 @@ static const struct proto_ops pptp_ops = {
        .ioctl      = pppox_ioctl,
 };
 
-static struct pppox_proto pppox_pptp_proto = {
+static const struct pppox_proto pppox_pptp_proto = {
        .create = pptp_create,
        .owner  = THIS_MODULE,
 };
 
-static struct gre_protocol gre_pptp_protocol = {
+static const struct gre_protocol gre_pptp_protocol = {
        .handler = pptp_rcv,
 };
 
index 29bcd55851ebed4dd2113965c2277f1e4c6bb9e6..397921b09ef9b792153e84fa8af24c8a96c98dc1 100644 (file)
@@ -204,7 +204,7 @@ struct pppox_proto {
        struct module   *owner;
 };
 
-extern int register_pppox_proto(int proto_num, struct pppox_proto *pp);
+extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
 extern void unregister_pppox_proto(int proto_num);
 extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
 extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
index ff954b3e94b6b3d6daab8bf7a538c15101bad782..39a21d0c61c48f2506bc7d24e7eeeee1610a11ae 100644 (file)
@@ -1768,7 +1768,7 @@ static const struct proto_ops pppol2tp_ops = {
        .ioctl          = pppox_ioctl,
 };
 
-static struct pppox_proto pppol2tp_proto = {
+static const struct pppox_proto pppol2tp_proto = {
        .create         = pppol2tp_create,
        .ioctl          = pppol2tp_ioctl
 };