Replace function call to direct variable reference

To avoid the reference of volatile variable via call stack,
function call to get value is replaced to direct reference.