diff options
author | Joel Granados <j.granados@samsung.com> | 2024-06-04 08:29:21 +0200 |
---|---|---|
committer | Joel Granados <j.granados@samsung.com> | 2024-06-13 10:50:52 +0200 |
commit | d7a76ec87195ced6910b0ca10ca133bb316c90f5 (patch) | |
tree | 70fc6091ac3e45e52a446659907628231ff2397a /fs/proc | |
parent | e2a6c472de7a5e5a1455a9fff1cfc55a1dd888af (diff) |
sysctl: Remove check for sentinel element in ctl_table arrays
Use ARRAY_SIZE exclusively by removing the check to ->procname in the
stopping criteria of the loops traversing ctl_table arrays. This commit
finalizes the removal of the sentinel elements at the end of ctl_table
arrays which reduces the build time size and run time memory bloat by
~64 bytes per sentinel (further information Link :
https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/)
Remove the entry->procname evaluation from the for loop stopping
criteria in sysctl and sysctl_net.
Signed-off-by: Joel Granados <j.granados@samsung.com>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/proc_sysctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index c467e36741d0..832de1c64b5a 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -21,7 +21,7 @@ #define list_for_each_table_entry(entry, header) \ entry = header->ctl_table; \ - for (size_t i = 0 ; i < header->ctl_table_size && entry->procname; ++i, entry++) + for (size_t i = 0 ; i < header->ctl_table_size; ++i, entry++) static const struct dentry_operations proc_sys_dentry_operations; static const struct file_operations proc_sys_file_operations; |