Vsevolod Myalitsin [off-list ref] writes:
Yes, I agree that passing the "advice_setting" itself is cleaner and
more future-proof. I will change "vadvise()" to take a pointer to the
corresponding "advice_setting" instead.
One minor glitch is that there is an ad-hoc vadvise() call in
advise() that is not tied to any particular entry in the
advise_setting[] table. I think we'd need to give a name to the
advice_setting struct type, instanciate an ad-hoc instance on stack,
and pass it down the callchain, perhaps like so:
void advise(const char *advice, ...)
{
struct advice_setting ad_hoc = {
.key = "",
.scope = CONFIG_SCOPE_UNKNOWN,
.level = 0,
};
va_list params;
va_start(params, advise);
vadvise(advise, &ad_hoc, params);
va_end(params);
}