]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
drm/radeon: silence GCC warning on 32 bit
authorPaul Bolle <pebolle@tiscali.nl>
Tue, 4 Mar 2014 09:34:48 +0000 (10:34 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Mar 2014 21:46:56 +0000 (16:46 -0500)
commit0d997b68574217b41c1288ee4c6728c7003aac1f
tree4e42dabb5c7fd32d8340d0533c2968425a269479
parentbc6a62955f6ea6aabe26292a21dbdd67f5b89b67
drm/radeon: silence GCC warning on 32 bit

Building radeon_ttm.o on 32 bit x86 triggers a warning:
    In file included from include/asm-generic/bug.h:13:0,
                     from [...]/arch/x86/include/asm/bug.h:38,
                     from include/linux/bug.h:4,
                     from include/drm/drm_mm.h:39,
                     from include/drm/drm_vma_manager.h:26,
                     from include/drm/ttm/ttm_bo_api.h:35,
                     from drivers/gpu/drm/radeon/radeon_ttm.c:32:
    drivers/gpu/drm/radeon/radeon_ttm.c: In function 'radeon_ttm_gtt_read':
    include/linux/kernel.h:712:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
      (void) (&_min1 == &_min2);  \
                     ^
    drivers/gpu/drm/radeon/radeon_ttm.c:938:22: note: in expansion of macro 'min'
       ssize_t cur_size = min(size, PAGE_SIZE - off);
                          ^

Silence this warning by using min_t(). Since cur_size will never be
negative and its upper bound is PAGE_SIZE, we can change its type to
size_t and use min_t(size_t, [...]) here.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/radeon/radeon_ttm.c