staging: lustre: ptlrpc: constify ptlrpc_sec_cops structs
PATCH v2 1/1 staging: lustre: ptlrpc: constify ptlrpc_sec_cops structs
Constifies ptlrpc_sec_cops structures in the lustre driver since they are not modified after their initialization.
Detected and found using Coccinelle.
Suggested-by Julia Lawall <[email protected]>
Signed-off-by Aya Mahfouz <[email protected]>
---
Changelog:
v2: added const to a ptlrpc_sec_cops structure in the definition of ptlrpc_sec_policy
drivers/staging/lustre/lustre/include/lustre_sec.h | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/include/lustre_sec.h +1 -1
@@ -779,7 +779,7 @@ struct ptlrpc_sec_policy {struct module *sp_owner;char *sp_name;__u16 sp_policy;/* policy number */ -struct ptlrpc_sec_cops *sp_cops;/* client ops */ +const struct ptlrpc_sec_cops *sp_cops;/* client ops */ struct ptlrpc_sec_sops *sp_sops;/* server ops */ };
drivers/staging/lustre/lustre/ptlrpc/sec.c +1 -1
@@ -1580,7 +1580,7 @@ int sptlrpc_cli_enlarge_reqbuf(struct ptlrpc_request *req, int segment, int newsize) {struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx; -struct ptlrpc_sec_cops *cops; +const struct ptlrpc_sec_cops *cops;struct lustre_msg *msg = req->rq_reqmsg;LASSERT (ctx);
drivers/staging/lustre/lustre/ptlrpc/sec_null.c +1 -1
@@ -378,7 +378,7 @@ static struct ptlrpc_ctx_ops null_ctx_ops = { .verify = null_ctx_verify, }; -static struct ptlrpc_sec_cops null_sec_cops = { +static const struct ptlrpc_sec_cops null_sec_cops = { .create_sec = null_create_sec, .destroy_sec = null_destroy_sec, .lookup_ctx = null_lookup_ctx,
drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +1 -1
@@ -956,7 +956,7 @@ static struct ptlrpc_ctx_ops plain_ctx_ops = { .unwrap_bulk = plain_cli_unwrap_bulk, }; -static struct ptlrpc_sec_cops plain_sec_cops = { +static const struct ptlrpc_sec_cops plain_sec_cops = { .create_sec = plain_create_sec, .destroy_sec = plain_destroy_sec, .kill_sec = plain_kill_sec,
Signature · 6 lines
2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz