diff options
author | Kurt Van Dijck <kurt.van.dijck@eia.be> | 2011-05-03 14:40:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-04 17:08:36 -0400 |
commit | 1650629d1800bf05ad775f974e931ca2fa03b0ff (patch) | |
tree | babd283e21f033bd9d1a15ccb0d658de43421170 /net/can/af_can.c | |
parent | 5a412ad7f4c95bb5b756aa12b52646e857e7c75d (diff) |
can: make struct can_proto const
commit 53914b67993c724cec585863755c9ebc8446e83b had the
same message. That commit did put everything in place but
did not make can_proto const itself.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/can/af_can.c')
-rw-r--r-- | net/can/af_can.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c index a8dcaa49675a..5b52762b9f20 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c | |||
@@ -84,7 +84,7 @@ static DEFINE_SPINLOCK(can_rcvlists_lock); | |||
84 | static struct kmem_cache *rcv_cache __read_mostly; | 84 | static struct kmem_cache *rcv_cache __read_mostly; |
85 | 85 | ||
86 | /* table of registered CAN protocols */ | 86 | /* table of registered CAN protocols */ |
87 | static struct can_proto *proto_tab[CAN_NPROTO] __read_mostly; | 87 | static const struct can_proto *proto_tab[CAN_NPROTO] __read_mostly; |
88 | static DEFINE_MUTEX(proto_tab_lock); | 88 | static DEFINE_MUTEX(proto_tab_lock); |
89 | 89 | ||
90 | struct timer_list can_stattimer; /* timer for statistics update */ | 90 | struct timer_list can_stattimer; /* timer for statistics update */ |
@@ -115,9 +115,9 @@ static void can_sock_destruct(struct sock *sk) | |||
115 | skb_queue_purge(&sk->sk_receive_queue); | 115 | skb_queue_purge(&sk->sk_receive_queue); |
116 | } | 116 | } |
117 | 117 | ||
118 | static struct can_proto *can_try_module_get(int protocol) | 118 | static const struct can_proto *can_try_module_get(int protocol) |
119 | { | 119 | { |
120 | struct can_proto *cp; | 120 | const struct can_proto *cp; |
121 | 121 | ||
122 | rcu_read_lock(); | 122 | rcu_read_lock(); |
123 | cp = rcu_dereference(proto_tab[protocol]); | 123 | cp = rcu_dereference(proto_tab[protocol]); |
@@ -132,7 +132,7 @@ static int can_create(struct net *net, struct socket *sock, int protocol, | |||
132 | int kern) | 132 | int kern) |
133 | { | 133 | { |
134 | struct sock *sk; | 134 | struct sock *sk; |
135 | struct can_proto *cp; | 135 | const struct can_proto *cp; |
136 | int err = 0; | 136 | int err = 0; |
137 | 137 | ||
138 | sock->state = SS_UNCONNECTED; | 138 | sock->state = SS_UNCONNECTED; |
@@ -691,7 +691,7 @@ drop: | |||
691 | * -EBUSY protocol already in use | 691 | * -EBUSY protocol already in use |
692 | * -ENOBUF if proto_register() fails | 692 | * -ENOBUF if proto_register() fails |
693 | */ | 693 | */ |
694 | int can_proto_register(struct can_proto *cp) | 694 | int can_proto_register(const struct can_proto *cp) |
695 | { | 695 | { |
696 | int proto = cp->protocol; | 696 | int proto = cp->protocol; |
697 | int err = 0; | 697 | int err = 0; |
@@ -728,7 +728,7 @@ EXPORT_SYMBOL(can_proto_register); | |||
728 | * can_proto_unregister - unregister CAN transport protocol | 728 | * can_proto_unregister - unregister CAN transport protocol |
729 | * @cp: pointer to CAN protocol structure | 729 | * @cp: pointer to CAN protocol structure |
730 | */ | 730 | */ |
731 | void can_proto_unregister(struct can_proto *cp) | 731 | void can_proto_unregister(const struct can_proto *cp) |
732 | { | 732 | { |
733 | int proto = cp->protocol; | 733 | int proto = cp->protocol; |
734 | 734 | ||