On 2023/3/2 09:12, Luis Chamberlain wrote:
That would solve the first part -- the fragile odd checks to bail out early. But not the odd accounting we have to do at times. So it begs the question if we can instead deprecate register_sysctl_table() and then have a counter for us at all times. Also maybe an even simpler alternative may just be to see to have the nr_entries be inferred with ARRAY_SIZE() if count_subheaders() == 1? I haven't looked into that yet. Luis
The current difficulty is to get the ARRAY_SIZE() of table->child table. It would be great if have a better way to solve this problem. Meng