• Zhang Lixu's avatar
    HID: intel-ish-hid: Fix build error for COMPILE_TEST · 23604972
    Zhang Lixu authored
    kernel test robot reported build error due to a pointer type mismatch:
    
      .../ishtp/loader.c:172:8: error: incompatible pointer types passing
      '__le64 *' (aka 'unsigned long long *') to parameter of type
      'dma_addr_t *' (aka 'unsigned int *')
    
    The issue arises because the driver, which is primarily intended for
    x86-64, is also built for i386 when COMPILE_TEST is enabled.
    
    Resolve type mismatch by using a temporary dma_addr_t variable to hold
    the DMA address. Populate this temporary variable in dma_alloc_coherent()
    function, and then convert and store the address in the
    fragment->fragment_tbl[i].ddr_adrs field in the correct format.
    Similarly, convert the ddr_adrs field back to dma_addr_t when freeing
    the DMA buffer with dma_free_coherent().
    
    Fixes: 579a267e ("HID: intel-ish-hid: Implement loading firmware from host feature")
    Reported-by: default avatarkernel test robot <lkp@intel.com>
    Closes: https://lore.kernel.org/oe-kbuild-all/202405201313.SAStVPrT-lkp@intel.com/Signed-off-by: default avatarZhang Lixu <lixu.zhang@intel.com>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
    23604972
loader.c 9 KB