netconsole: consolidate send buffers into netconsole_target struct
authorBreno Leitao <leitao@debian.org>
Thu, 6 Feb 2025 11:05:52 +0000 (03:05 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Feb 2025 15:04:17 +0000 (15:04 +0000)
commit1c1377d7b60c2d96eefab0bd9740d4a27fb0e1d3
tree42d47c7e4bed248f6281dfb9e14abbd53a10abd1
parentacdefab0dcbc3833b5a734ab80d792bb778517a0
netconsole: consolidate send buffers into netconsole_target struct

Move the static buffers from send_msg_no_fragmentation() and
send_msg_fragmented() into the netconsole_target structure. This
simplifies the code by:
- Eliminating redundant static buffers
- Centralizing buffer management in the target structure
- Reducing memory usage by 1KB (one buffer instead of two)

The buffer in netconsole_target is protected by target_list_lock,
maintaining the same synchronization semantics as the original code.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netconsole.c