VSOCK: constify vmci_transport_notify_ops structures
authorJulia Lawall <julia.lawall@lip6.fr>
Sat, 21 Nov 2015 17:39:17 +0000 (18:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Nov 2015 20:49:29 +0000 (15:49 -0500)
The vmci_transport_notify_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/vmw_vsock/vmci_transport.h
net/vmw_vsock/vmci_transport_notify.c
net/vmw_vsock/vmci_transport_notify.h
net/vmw_vsock/vmci_transport_notify_qstate.c

index 2ad46f39649f8130d9f19ce48ccf8a8b4309797d..1820e74a575281bce3dc2fdf264a079345a24e63 100644 (file)
@@ -121,7 +121,7 @@ struct vmci_transport {
        u64 queue_pair_max_size;
        u32 detach_sub_id;
        union vmci_transport_notify notify;
-       struct vmci_transport_notify_ops *notify_ops;
+       const struct vmci_transport_notify_ops *notify_ops;
        struct list_head elem;
        struct sock *sk;
        spinlock_t lock; /* protects sk. */
index 9b7f207f2bee08770675f603a2ac20926937f06c..fd8cf0214d514f777736fade0a707a509e8829ec 100644 (file)
@@ -661,7 +661,7 @@ static void vmci_transport_notify_pkt_process_negotiate(struct sock *sk)
 }
 
 /* Socket control packet based operations. */
-struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
+const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops = {
        vmci_transport_notify_pkt_socket_init,
        vmci_transport_notify_pkt_socket_destruct,
        vmci_transport_notify_pkt_poll_in,
index 7df793249b6cda01fa37ddd020510d5042999f55..3c464d394a8f5d9a9d9747ea2ca0a7a1f9f05604 100644 (file)
@@ -77,7 +77,8 @@ struct vmci_transport_notify_ops {
        void (*process_negotiate) (struct sock *sk);
 };
 
-extern struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops;
-extern struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops;
+extern const struct vmci_transport_notify_ops vmci_transport_notify_pkt_ops;
+extern const
+struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops;
 
 #endif /* __VMCI_TRANSPORT_NOTIFY_H__ */
index dc9c7929a2f959f533e198c6e0c178571f2abd9d..21e591dafb031c728e3f3c8bc624750b54e94f94 100644 (file)
@@ -419,7 +419,7 @@ vmci_transport_notify_pkt_send_pre_enqueue(
 }
 
 /* Socket always on control packet based operations. */
-struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
+const struct vmci_transport_notify_ops vmci_transport_notify_pkt_q_state_ops = {
        vmci_transport_notify_pkt_socket_init,
        vmci_transport_notify_pkt_socket_destruct,
        vmci_transport_notify_pkt_poll_in,