]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: fix type mismatch error on sparc64
authorHuang Rui <ray.huang@amd.com>
Tue, 7 Sep 2021 10:03:02 +0000 (18:03 +0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Sep 2021 20:36:02 +0000 (13:36 -0700)
commit9250d26832e50bcc7539bfb1487e7358416de8d3
tree77045c2837fb5d0db7d90d5ff32d439ad6d680f9
parent14cda2ccc54b3b907a6ec28d76b1a3c77517a167
drm/ttm: fix type mismatch error on sparc64

On sparc64, __fls() returns an "int", but the drm TTM code expected it
to be "unsigned long" as on x86.  As a result, on sparc (and arc, and
m68k) you get build errors because 'min()' checks that the types match.

As suggested by Linus, it can use min_t instead of min to force the type
to be "unsigned int".

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpu/drm/ttm/ttm_pool.c