#ifdef DIAGNOSTIC ... panic... #endif -> KASSERT
KNF a comment.
Trailing whitespace
KNF. No brackets around return value.