rename __buf to kbuf.
use const
fix: better order of struct members.
fix: local definition
refactor: make a util function.
fix: bad assertion and cast.
fix: use ().
fix: bad cast.
fix: make variables local.
fix: unnecessary cast.
Merge branch 'review-work' into develop