[PATCH 5.18 226/231] power: supply: core: Fix boundary conditions in interpolation