[PATCH 1/2] dm: core: Add functions to read 8/16-bit integers