Thread (17 messages) 17 messages, 6 authors, 2024-05-07

Re: [PATCH net-next v6 8/8] ax.25: x.25: Remove the now superfluous sentinel elements from ctl_table array

From: Joel Granados <hidden>
Date: 2024-05-03 12:18:19
Also in: bridge, linux-hams, linux-nfs, linux-rdma, linux-s390, linux-sctp, lkml, lvs-devel, mptcp, netfilter-devel

On Wed, May 01, 2024 at 03:15:54PM +0200, Sabrina Dubroca wrote:
2024-05-01, 11:29:32 +0200, Joel Granados via B4 Relay wrote:
quoted
From: Joel Granados <redacted>

This commit comes at the tail end of a greater effort to remove the
empty elements at the end of the ctl_table arrays (sentinels) which will
reduce the overall build time size of the kernel and run time memory
bloat by ~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/ (local))

Avoid a buffer overflow when traversing the ctl_table by ensuring that
AX25_MAX_VALUES is the same as the size of ax25_param_table. This is
done with a BUILD_BUG_ON where ax25_param_table is defined and a
CONFIG_AX25_DAMA_SLAVE guard in the unnamed enum definition as well as
in the ax25_dev_device_up and ax25_ds_set_timer functions.
                                ^^
nit:                            not anymore ;)
(but not worth a repost IMO)

quoted
diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c
index c4f8adbf8144..c50a58d9e368 100644
--- a/net/ax25/ax25_ds_timer.c
+++ b/net/ax25/ax25_ds_timer.c
@@ -55,6 +55,7 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev)
 	ax25_dev->dama.slave_timeout =
 		msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10;
 	mod_timer(&ax25_dev->dama.slave_timer, jiffies + HZ);
+	return;
nit: return not needed here since we're already at the bottom of the
function, but probably not worth a repost of the series.
Thx. I will not repost, but I have changed them locally so they are
there in case a V7 is required.

Best
-- 

Joel Granados

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help