Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753609AbbKWVmj (ORCPT ); Mon, 23 Nov 2015 16:42:39 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:37766 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643AbbKWVmi (ORCPT ); Mon, 23 Nov 2015 16:42:38 -0500 Date: Mon, 23 Nov 2015 23:42:34 +0200 From: Aya Mahfouz To: Oleg Drokin , Andreas Dilger , Greg Kroah-Hartman , Julia Lawall , lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: lustre: ptlrpc: constify ptlrpc_sec_cops structs Message-ID: <20151123214234.GA9568@waves> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2483 Lines: 64 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 Signed-off-by: Aya Mahfouz --- 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 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 39f5261..f959897 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -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); diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index ebfa609..ffdad15 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -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, diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c index f448b45..71351de 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c @@ -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, -- 2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/