mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 02:20:48 +00:00
3dc53814db8809fe18b21cc2ae89f50d04358ce4
We use rand to get timestamp counter low word and do random test (test_dev = rand % i2c_test_dev_used). But we will get a negative index (test_dev) if low word larger than 0x80000000 and cause the array to access the wrong locations and trigger an exception. This change also fix following error: error: i2c_s_test may be used uninitialized in this function [-Werror=maybe-uninitialized] BRANCH=none BUG=none TEST="forcetime 0 0x80000000" then "i2ctest", no exception triggered. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Ia2f5a2ff034a6b7b96f7bd4f3b42bf5645a05aed Reviewed-on: https://chromium-review.googlesource.com/663110 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
For an overview of the Embedded Controller firmware, refer to http://www.chromium.org/chromium-os/2014-firmware-summit For instructions on building from source, refer to http://www.chromium.org/chromium-os/ec-development/getting-started-building-ec-images-quickly
Description
Languages
C
64.7%
Lasso
20.7%
ASL
3.6%
JavaScript
3.2%
C#
2.9%
Other
4.6%