• Arnd Bergmann's avatar
    android: binder: fix type mismatch warning · 1c363eae
    Arnd Bergmann authored
    Allowing binder to expose the 64-bit API on 32-bit kernels caused a
    build warning:
    
    drivers/android/binder.c: In function 'binder_transaction_buffer_release':
    drivers/android/binder.c:2220:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        fd_array = (u32 *)(parent_buffer + fda->parent_offset);
                   ^
    drivers/android/binder.c: In function 'binder_translate_fd_array':
    drivers/android/binder.c:2445:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      fd_array = (u32 *)(parent_buffer + fda->parent_offset);
                 ^
    drivers/android/binder.c: In function 'binder_fixup_parent':
    drivers/android/binder.c:2511:18: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
    
    This adds extra type casts to avoid the warning.
    
    However, there is another problem with the Kconfig option: turning
    it on or off creates two incompatible ABI versions, a kernel that
    has this enabled cannot run user space that was built without it
    or vice versa. A better solution might be to leave the option hidden
    until the binder code is fixed to deal with both ABI versions.
    
    Fixes: e8d2ed7d ("Revert "staging: Fix build issues with new binder API"")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    1c363eae
binder.c 157 KB