nvmf_rpc: remove a redundant '\n'

For example:
Got JSON-RPC error response
response:
{
  "code": -32602,
  "message": "Invalid transport type 'rdma'\n"
}
The \n here is redundant.

Change-Id: I30a22f93f2be2550fdbe2af2d90eaa1c381dc7ae
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4655
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
wanghailiangx 2020-10-14 12:25:18 -04:00 committed by Tomasz Zawadzki
parent ed65607cf9
commit 10f712bc99

View File

@ -1924,7 +1924,7 @@ nvmf_rpc_tgt_add_transport_done(void *cb_arg, int status)
if (status) { if (status) {
SPDK_ERRLOG("Failed to add transport to tgt.(%d)\n", status); SPDK_ERRLOG("Failed to add transport to tgt.(%d)\n", status);
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
"Failed to add transport to tgt.(%d)\n", "Failed to add transport to tgt.(%d)",
status); status);
return; return;
} }
@ -1971,7 +1971,7 @@ rpc_nvmf_create_transport(struct spdk_jsonrpc_request *request,
if (spdk_nvme_transport_id_parse_trtype(&trtype, ctx->trtype)) { if (spdk_nvme_transport_id_parse_trtype(&trtype, ctx->trtype)) {
SPDK_ERRLOG("Invalid transport type '%s'\n", ctx->trtype); SPDK_ERRLOG("Invalid transport type '%s'\n", ctx->trtype);
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
"Invalid transport type '%s'\n", ctx->trtype); "Invalid transport type '%s'", ctx->trtype);
nvmf_rpc_create_transport_ctx_free(ctx); nvmf_rpc_create_transport_ctx_free(ctx);
return; return;
} }
@ -1985,7 +1985,7 @@ rpc_nvmf_create_transport(struct spdk_jsonrpc_request *request,
*/ */
SPDK_ERRLOG("Invalid transport type '%s'\n", ctx->trtype); SPDK_ERRLOG("Invalid transport type '%s'\n", ctx->trtype);
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
"Invalid transport type '%s'\n", ctx->trtype); "Invalid transport type '%s'", ctx->trtype);
nvmf_rpc_create_transport_ctx_free(ctx); nvmf_rpc_create_transport_ctx_free(ctx);
return; return;
} }
@ -2002,7 +2002,7 @@ rpc_nvmf_create_transport(struct spdk_jsonrpc_request *request,
if (spdk_nvmf_tgt_get_transport(tgt, ctx->trtype)) { if (spdk_nvmf_tgt_get_transport(tgt, ctx->trtype)) {
SPDK_ERRLOG("Transport type '%s' already exists\n", ctx->trtype); SPDK_ERRLOG("Transport type '%s' already exists\n", ctx->trtype);
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
"Transport type '%s' already exists\n", ctx->trtype); "Transport type '%s' already exists", ctx->trtype);
nvmf_rpc_create_transport_ctx_free(ctx); nvmf_rpc_create_transport_ctx_free(ctx);
return; return;
} }
@ -2012,7 +2012,7 @@ rpc_nvmf_create_transport(struct spdk_jsonrpc_request *request,
if (!transport) { if (!transport) {
SPDK_ERRLOG("Transport type '%s' create failed\n", ctx->trtype); SPDK_ERRLOG("Transport type '%s' create failed\n", ctx->trtype);
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
"Transport type '%s' create failed\n", ctx->trtype); "Transport type '%s' create failed", ctx->trtype);
nvmf_rpc_create_transport_ctx_free(ctx); nvmf_rpc_create_transport_ctx_free(ctx);
return; return;
} }