diff mbox series

[2/8] trace-cmd: Rename error_operation_for_server

Message ID 20190204070855.8921-3-kaslevs@vmware.com (mailing list archive)
State Accepted
Commit 1389ff4a817099a8c11be5e7e891ed54e2500100
Headers show
Series trace-cmd protocol fixes | expand

Commit Message

Slavomir Kaslev Feb. 4, 2019, 7:08 a.m. UTC
No changes in behavior intended.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
---
 tracecmd/trace-msg.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/tracecmd/trace-msg.c b/tracecmd/trace-msg.c
index 418a22d..ffebce7 100644
--- a/tracecmd/trace-msg.c
+++ b/tracecmd/trace-msg.c
@@ -345,6 +345,12 @@  void tracecmd_msg_set_done(struct tracecmd_msg_handle *msg_handle)
 	msg_server->done = true;
 }
 
+static void error_operation(struct tracecmd_msg *msg)
+{
+	warning("Message: cmd=%d size=%d\n",
+		ntohl(msg->hdr.cmd), ntohl(msg->hdr.size));
+}
+
 /*
  * A return value of 0 indicates time-out
  */
@@ -432,15 +438,6 @@  static bool process_option(struct tracecmd_msg_handle *msg_handle,
 	return false;
 }
 
-static void error_operation_for_server(struct tracecmd_msg *msg)
-{
-	u32 cmd;
-
-	cmd = ntohl(msg->hdr.cmd);
-
-	warning("Message: cmd=%d size=%d\n", cmd, ntohl(msg->hdr.size));
-}
-
 struct tracecmd_msg_handle *
 tracecmd_msg_handle_alloc(int fd, unsigned long flags)
 {
@@ -545,7 +542,7 @@  int tracecmd_msg_initial_setting(struct tracecmd_msg_handle *msg_handle)
 	return pagesize;
 
 error:
-	error_operation_for_server(&msg);
+	error_operation(&msg);
 	return ret;
 }
 
@@ -670,7 +667,7 @@  int tracecmd_msg_read_data(struct tracecmd_msg_handle *msg_handle, int ofd)
 	return 0;
 
 error:
-	error_operation_for_server(&msg);
+	error_operation(&msg);
 	msg_free(&msg);
 	return ret;
 }
@@ -709,7 +706,7 @@  int tracecmd_msg_collect_data(struct tracecmd_msg_handle *msg_handle, int ofd)
 	return 0;
 
 error:
-	error_operation_for_server(&msg);
+	error_operation(&msg);
 	msg_free(&msg);
 	return ret;
 }