On 6/14/22 11:56, Mike Rapoport wrote:
But, I cannot take it anymore: the list of arguments for uffd stuff is
crazy. I would like to collect all the possible arguments that are used for
uffd operation into some “struct uffd_op”.
Squashing boolean parameters into int flags will also reduce the insane
amount of parameters. No strong feelings though.
Just a quick drive-by comment about boolean arguments: they ruin the
readability of the call sites. In practice, sometimes a single boolean
argument can be OK-ish (still poor to read at the call site, but easier
to code initially), but once you get past one boolean argument in the
function, readability is hopeless:
foo(ptr, true, false, a == b);
So if you have a choice, I implore you to prefer flags and/or enums. :)
thanks,
--
John Hubbard
NVIDIA