git: drm/linux: Improve linux/log2.h

Rimvydas Jasinskas zrj at
Sat Jan 20 03:30:41 PST 2018

commit b42e8066bb51657fe02c08196d8e571f7248f249
Author: zrj <rimvydas.jasinskas at>
Date:   Sat Jan 20 12:29:06 2018 +0200

    drm/linux: Improve linux/log2.h
    With newer GCC compilers it is no longer possible to easily detect bad
    cases of ilog2() usage in drm shim, see:
    There is just a single use case of this macro in drm/radeon/radeon_device.c
    for radeon_vm_size, it is already checked to be positive 2^N small number.
    So simplify macro and just return 0 for n < 2.
    While there, adjust logic to use proper fls(3) and flsll(3) functions
    based on integer size (previously both cases where calling flsl(3)).

Summary of changes:
 sys/dev/drm/include/linux/log2.h | 48 ++++++----------------------------------
 1 file changed, 7 insertions(+), 41 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list