Files
OpenCellular/common
Dino Li 3dc53814db i2c: rand of i2ctest console command is unsigned
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>
2017-09-13 19:28:30 -07:00
..
2017-08-29 19:37:05 -07:00
2017-09-13 17:13:54 -07:00
2015-05-19 02:46:27 +00:00
2016-11-15 17:41:53 -08:00
2017-08-12 22:58:43 -07:00
2017-09-11 11:14:24 -07:00
2016-03-02 13:39:47 -08:00
2017-09-11 11:14:24 -07:00
2017-06-02 10:38:57 -07:00
2014-05-17 20:14:17 +00:00
2016-03-21 16:35:33 -07:00
2017-05-09 23:20:07 -07:00
2017-08-10 22:47:24 -07:00
2017-08-23 12:19:07 -07:00