math_util: Support fp_div_dbz which handling division-by-zero error.
math_util: Support fp_div_dbz which handling division-by-zero error.

Fixed-point numbers has limited value range.  It is very easy to
be trapped in a division-by-zero error especially when doing
magnetometer calculation.  We only use fixed-point operations for
motion sensors now, so the precision and correctness for these
operations is not the most important point to consider.  Here
we just let divided-by-zero result becomes INT32_MAX, to prevent
the system failure.

TEST=undef CONFIG_FPU, build, flash on reef, and test magnetometer, and
     see the system doesn't crash.
BUG=b:113364863
BRANCH=None

Change-Id: I0ab657b2132666eefa9f3a04043ce29f0096d238
Signed-off-by: Yilun Lin <2f2733c7206ea2b76bd2db1905cc5e8a75841c48@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1248421
Commit-Ready: Yilun Lin <2f2733c7206ea2b76bd2db1905cc5e8a75841c48@chromium.org>
Tested-by: Yilun Lin <2f2733c7206ea2b76bd2db1905cc5e8a75841c48@chromium.org>
Reviewed-by: Nicolas Boichat <f3daba1cdc403799935674d3cd4b0e5bd1804232@chromium.org>

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