[PATCH net-next v4 5/5] netconsole: pass wctxt to send_msg_udp() for consistency

Breno Leitao posted 5 patches 2 weeks, 2 days ago
There is a newer version of this series
[PATCH net-next v4 5/5] netconsole: pass wctxt to send_msg_udp() for consistency
Posted by Breno Leitao 2 weeks, 2 days ago
Refactor send_msg_udp() to take a struct nbcon_write_context pointer
instead of separate msg and len parameters. This makes its signature
consistent with send_ext_msg_udp() and prepares the function for
future use of execution context information from wctxt.

No functional change.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/net/netconsole.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 0f44ce5ccc0ab..d1dadb7e0350f 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -1865,16 +1865,16 @@ static void send_ext_msg_udp(struct netconsole_target *nt,
 				   sysdata_len);
 }
 
-static void send_msg_udp(struct netconsole_target *nt, const char *msg,
-			 unsigned int len)
+static void send_msg_udp(struct netconsole_target *nt,
+			 struct nbcon_write_context *wctxt)
 {
-	const char *tmp = msg;
-	int frag, left = len;
+	const char *msg = wctxt->outbuf;
+	int frag, left = wctxt->len;
 
 	while (left > 0) {
 		frag = min(left, MAX_PRINT_CHUNK);
-		send_udp(nt, tmp, frag);
-		tmp += frag;
+		send_udp(nt, msg, frag);
+		msg += frag;
 		left -= frag;
 	}
 }
@@ -1908,7 +1908,7 @@ static void netconsole_write(struct nbcon_write_context *wctxt, bool extended)
 		if (extended)
 			send_ext_msg_udp(nt, wctxt);
 		else
-			send_msg_udp(nt, wctxt->outbuf, wctxt->len);
+			send_msg_udp(nt, wctxt);
 
 		nbcon_exit_unsafe(wctxt);
 	}

-- 
2.47.3