All of lore.kernel.org
 help / color / mirror / Atom feed
* likely signedness bug in drm and nvidia drivers
@ 2015-07-20 20:46 ` Rasmus Villemoes
  0 siblings, 0 replies; 6+ messages in thread
From: Rasmus Villemoes @ 2015-07-20 20:46 UTC (permalink / raw)
  To: Ben Skeggs, David Airlie, Antonino Daplas, Tomi Valkeinen
  Cc: linux-fbdev, dri-devel

Hi,

The files

  drivers/gpu/drm/nouveau/nv50_fbcon.c
  drivers/gpu/drm/nouveau/nvc0_fbcon.c
  drivers/video/fbdev/nvidia/nv_accel.c

all contain a right-shift of ~0 (aka -1) - just grep for '~0 >>'. gcc
always does arithmetic right shift of signed types, which means that the
result is always -1 again [type promotion/conversion doesn't kick in
until after the shift subexpression has been evaluated], independent of
the second operand. I can hardly believe that is intended (the result is
used as a mask, which thus consists of all 1s). If these are indeed
bugs, the patch is obvious (just make the literal an unsigned 0).

Rasmus

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-21  8:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-20 20:46 likely signedness bug in drm and nvidia drivers Rasmus Villemoes
2015-07-20 20:46 ` Rasmus Villemoes
2015-07-21  2:44 ` Ilia Mirkin
2015-07-21  2:44   ` Ilia Mirkin
2015-07-21  8:56   ` Daniel Thompson
2015-07-21  8:56     ` Daniel Thompson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.