linux_dsm_epyc7002/drivers/gpu/drm/i2c
Daniel Vetter 8268bd48af 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 <rmk+kernel@arm.linux.org.uk>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Jean-Francois Moine <moinejf@free.fr>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-22 15:39:41 +02:00
..
ch7006_drv.c drm: encapsulate crtc->set_config calls 2013-01-20 15:57:58 +01:00
ch7006_mode.c drm: Make the .mode_fixup() operations mode argument a const pointer 2012-07-19 21:52:38 -04:00
ch7006_priv.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
Kconfig drm/i2c: nxp-tda998x (v3) 2013-02-19 17:57:44 -05:00
Makefile drm/i2c: nxp-tda998x (v3) 2013-02-19 17:57:44 -05:00
sil164_drv.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
tda998x_drv.c drm/i2c/tda998x: Fix signed overflow issue 2014-04-22 15:39:41 +02:00