Some messages in vm_domainset_iter_next() would wrongly refer to
vm_domainset_iter_first(). While here, ensure that all assertion/panic
messages use 'func' to avoid this discrepancy in the future if code
is moved/copy-pasted again.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
bde was very much against func, on the basis that it makes harder to look for the corresponding literal string using grep or indexing.
That said, might be func should be consumed by KASSERT internals.
That prevention is somewhat understandable, but overall the argument looks weak. With the correct function name, you can immediately jump to the definition thanks to source code indexing (or, given our formatting convention for functions, a simple grep). Also, it is not too hard in general to make printed messages mostly unique, if that matters in some corner cases.
Personally, I find having the wrong function printed quite annoying and easily error-inducing when quickly browsing through code. So, on the contrary, I would advise using __func__ as the default, except on specific cases, and would support your idea of integrating __func__ into KASSERT().