net/tls: Constify base proto ops used for building tls proto
authorJakub Sitnicki <jakub@cloudflare.com>
Tue, 17 Mar 2020 17:04:37 +0000 (18:04 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Mar 2020 03:08:17 +0000 (20:08 -0700)
The helper that builds kTLS proto ops doesn't need to and should not modify
the base proto ops. Annotate the parameter as read-only.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_main.c

index 82225bcc1117c7cd940f88ba20a900aeb28773de..ff08b2ff75979d8c71da3cfac373f16643533fdc 100644 (file)
@@ -63,7 +63,7 @@ static DEFINE_MUTEX(tcpv4_prot_mutex);
 static struct proto tls_prots[TLS_NUM_PROTS][TLS_NUM_CONFIG][TLS_NUM_CONFIG];
 static struct proto_ops tls_sw_proto_ops;
 static void build_protos(struct proto prot[TLS_NUM_CONFIG][TLS_NUM_CONFIG],
-                        struct proto *base);
+                        const struct proto *base);
 
 void update_sk_prot(struct sock *sk, struct tls_context *ctx)
 {
@@ -652,7 +652,7 @@ static void tls_build_proto(struct sock *sk)
 }
 
 static void build_protos(struct proto prot[TLS_NUM_CONFIG][TLS_NUM_CONFIG],
-                        struct proto *base)
+                        const struct proto *base)
 {
        prot[TLS_BASE][TLS_BASE] = *base;
        prot[TLS_BASE][TLS_BASE].setsockopt     = tls_setsockopt;