From: Daniel Vetter Date: Sat, 5 Apr 2014 16:24:29 +0000 (+0200) Subject: drm/i2c/tda998x: Fix signed overflow issue X-Git-Tag: omap-for-v3.16/fixes-against-rc1~44^2~60^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8268bd48af9aae5e079d3ba8403ae459ff06cbcb;p=pandora-kernel.git drm/i2c/tda998x: Fix signed overflow issue This is C standard hair-splitting, but afaict - sum will be promoted to signed int in computation since uint8_t fits - signed overflow is undefined. No we need to add up an awful lot of bytes to actually make it overflow. But I guess the real risk is gcc spotting this and going bananas. Fix this by simply using unsigned in to force all computations to use the well-defined unsigned behaviour. Spotted by coverity. v2: Simplify the entire computation as suggested by Jean. Cc: Russell King Cc: Rob Clark Cc: Jean-Francois Moine Reviewed-by: David Herrmann Signed-off-by: Daniel Vetter --- Reading git-diff-tree failed