[lustre-devel] [PATCH 027/151] lustre: ptlrpc: Use C99 initializer in ptlrpc_register_rqbd()

James Simmons jsimmons at infradead.org
Mon Sep 30 11:54:46 PDT 2019


From: Steve Guminski <stephenx.guminski at intel.com>

This patch makes no functional changes. The struct initializer in
ptlrpc_register_rqbd() is updated to C99 syntax.

C89 positional initializers require values to be placed in the
correct order. This will cause errors if the fields of the struct
definition are reordered or fields are added or removed. C99 named
initializers avoid this problem, and also automatically clear any
values that are not explicitly set.

WC-bug-id: https://jira.whamcloud.com/browse/LU-6210
Lustre-commit: 3af10d510078 ("LU-6210 ptlrpc: Use C99 initializer in ptlrpc_register_rqbd()")
Reviewed-on: https://review.whamcloud.com/28479
Signed-off-by: Steve Guminski <stephenx.guminski at intel.com>
Reviewed-by: James Simmons <uja.ornl at yahoo.com>
Reviewed-by: John L. Hammond <jhammond at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/ptlrpc/niobuf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/ptlrpc/niobuf.c b/fs/lustre/ptlrpc/niobuf.c
index e7aff51..f2b7902 100644
--- a/fs/lustre/ptlrpc/niobuf.c
+++ b/fs/lustre/ptlrpc/niobuf.c
@@ -747,7 +747,10 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
 int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
 {
 	struct ptlrpc_service *service = rqbd->rqbd_svcpt->scp_service;
-	static struct lnet_process_id match_id = {LNET_NID_ANY, LNET_PID_ANY};
+	static struct lnet_process_id match_id = {
+		.nid = LNET_NID_ANY,
+		.pid = LNET_PID_ANY
+	};
 	int rc;
 	struct lnet_md md;
 	struct lnet_handle_me me_h;
-- 
1.8.3.1



More information about the lustre-devel mailing list