Skip to content
Commit e1b41e4f authored by Joel Granados's avatar Joel Granados Committed by Luis Chamberlain
Browse files

sysctl: SIZE_MAX->ARRAY_SIZE in register_net_sysctl



Replace SIZE_MAX with ARRAY_SIZE in the register_net_sysctl macro. Now
that all the callers to register_net_sysctl are actual arrays, we can
call ARRAY_SIZE() without any compilation warnings. By calculating the
actual array size, this commit is making sure that register_net_sysctl
and all its callers forward the table_size into sysctl backend for when
the sentinel elements in the ctl_table arrays (last empty markers) are
removed. Without it the removal would fail lacking a stopping criteria
for traversing the ctl_table arrays.

Stopping condition continues to be based on both table size and the
procname null test. This is needed in order to allow for the systematic
removal al the sentinel element in subsequent commits: Before removing
sentinel the stopping criteria will be the last null element. When the
sentinel is removed then the (correct) size will take over.

Signed-off-by: default avatarJoel Granados <j.granados@samsung.com>
Suggested-by: default avatarJani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent 3ca9aa74
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment