soc/intel/{common,apollolake}: Add checks to handle negative values
commit7f72c641957344e05176b7f31b0fffca434f4be7
authorRizwan Qureshi <rizwan.qureshi@intel.com>
Wed, 4 Oct 2017 13:23:19 +0000 (4 18:53 +0530)
committerMartin Roth <martinroth@google.com>
Thu, 5 Oct 2017 17:47:02 +0000 (5 17:47 +0000)
tree27bc06dbae2fe35cfea7c68f7f6cc89941704ad5
parentb3e18c7a434700ace381443a0e16718d8c6af7f6
soc/intel/{common,apollolake}: Add checks to handle negative values

Fix issues reported by coverity scan in the below files.

src/soc/intel/common/block/i2c
1375440: Improper use of negative value
1375441: Improper use of negative value
1375444: Improper use of negative value

src/soc/intel/apollolake/i2c.c
1375442: Unsigned compared against 0

Change-Id: Ic65400c934631e3dcd3aa664c24cb451616e7f4d
Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com>
Reviewed-on: https://review.coreboot.org/21875
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
src/soc/intel/apollolake/i2c.c
src/soc/intel/common/block/i2c/i2c.c