Re: [PATCH v4 1/2] fs/proc: optimize exactly register one ctl_table

Davidlohr Bueso
2022-03-12T06:23:17Z

On Fri, 04 Mar 2022, Xiaoming Ni wrote:
>For example,
>
>+ #define register_sysctl_init(path, table)
>__register_sysctl_init(path, table, ARRAY_SIZE(table))
>...
>- for (entry = table; entry->procname; entry++, node++)
>+ for (entry = table; entry->procname && num > 0; entry++, node++, num--) {

Furthermore the other iteratators could be consolidated such as:

+#define for_each_table_entry(entry, table) \
+ for ((entry) = (table); (entry)->procname; (entry)++)

.... probably before this patch.

Thanks,
Davidlohr