]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix comparison bug
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Mon, 28 Sep 2015 21:08:50 +0000 (23:08 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 30 Sep 2015 08:20:35 +0000 (10:20 +0200)
commitb71183aee47fa0a1ba10f71b70e8b2ddf6a1f073
treee6ca8cccefe91a79f32617e167bca140c74da3b3
parent7ebeba91ee79e3790a27f0164af7e152a270a2ac
drm/i915: Fix comparison bug

->stolen->start has type u64 aka unsigned long long; relying on the
difference (effectively cast to int) for sorting is wrong.

It wouldn't be a problem in practice if the values compared are always
within INT_MAX of each other (so that the difference is actually
representable in an int), but 6e8a0a450f9f ("drm/mm: Support 4 GiB and
larger ranges") strongly suggests that's not the case.

Note: atm we don't support more than about 1G of stolen, so this is
impossible currenlty.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
[danvet: Add note that this is impossible currently.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c