]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: netconsole: split send_ext_msg_udp() function
authorBreno Leitao <leitao@debian.org>
Thu, 17 Oct 2024 09:50:17 +0000 (02:50 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 22 Oct 2024 13:44:24 +0000 (15:44 +0200)
commite7650d8d475c4706a1841fbaab652e1fc8a7313c
tree0e62bae653514bcdbfeb5f94ab62012dd8ae9ca1
parentab49de0f7a08c442ebdc097f6701e8bc4db6b432
net: netconsole: split send_ext_msg_udp() function

The send_ext_msg_udp() function has become quite large, currently
spanning 102 lines. Its complexity, along with extensive pointer and
offset manipulation, makes it difficult to read and error-prone.

The function has evolved over time, and it’s now due for a refactor.

To improve readability and maintainability, isolate the case where no
message fragmentation occurs into a separate function, into a new
send_msg_no_fragmentation() function. This scenario covers about 95% of
the messages.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/netconsole.c