fuel_gauge: Simplify edge cases
fuel_gauge: Simplify edge cases

Update the local static function to take the type in and use an
assert since the bound checking is done at the call site. Also,
improve the bounds checking to >= BATTERY_TYPE_COUNT.

BRANCH=none
BUG=none
TEST=twister

Signed-off-by: Yuval Peress <50dc11c009bd4d7e9d9d15a383c1743ce5ee82ef@google.com>
Change-Id: Ia79bdaafdcd6c48d29d8cef5f981f746066d35b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4030056
Code-Coverage: Zoss <345cf107e82c70959d46f59d98bddc98ce458aff@prod.google.com>
Reviewed-by: Aaron Massey <79529a820df71f45023239a3663736629646cc34@google.com>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec