Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: qat - use swab32 macro

Replace __builtin_bswap32() with swab32 in icp_qat_hw_20_comp.h to fix
the following build errors on architectures without native byte-swap
support:

alpha-linux-ld: drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.o: in function `adf_gen4_build_decomp_block':
drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h:141:(.text+0xeec): undefined reference to `__bswapsi2'
alpha-linux-ld: drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h:141:(.text+0xef8): undefined reference to `__bswapsi2'
alpha-linux-ld: drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.o: in function `adf_gen4_build_comp_block':
drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h:57:(.text+0xf64): undefined reference to `__bswapsi2'
alpha-linux-ld: drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h:57:(.text+0xf7c): undefined reference to `__bswapsi2'

Fixes: 5b14b2b307e4 ("crypto: qat - enable deflate for QAT GEN4")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603290259.Ig9kDOmI-lkp@intel.com/
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Giovanni Cabiddu and committed by
Herbert Xu
35ecb77a f2e25a4c

+6 -4
+6 -4
drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h
··· 3 3 #ifndef _ICP_QAT_HW_20_COMP_H_ 4 4 #define _ICP_QAT_HW_20_COMP_H_ 5 5 6 + #include <linux/swab.h> 7 + 6 8 #include "icp_qat_hw_20_comp_defs.h" 7 9 #include "icp_qat_fw.h" 8 10 ··· 56 54 QAT_FIELD_SET(val32, csr.abd, ICP_QAT_HW_COMP_20_CONFIG_CSR_ABD_BITPOS, 57 55 ICP_QAT_HW_COMP_20_CONFIG_CSR_ABD_MASK); 58 56 59 - return __builtin_bswap32(val32); 57 + return swab32(val32); 60 58 } 61 59 62 60 struct icp_qat_hw_comp_20_config_csr_upper { ··· 108 106 ICP_QAT_HW_COMP_20_CONFIG_CSR_NICE_PARAM_BITPOS, 109 107 ICP_QAT_HW_COMP_20_CONFIG_CSR_NICE_PARAM_MASK); 110 108 111 - return __builtin_bswap32(val32); 109 + return swab32(val32); 112 110 } 113 111 114 112 struct icp_qat_hw_decomp_20_config_csr_lower { ··· 140 138 ICP_QAT_HW_DECOMP_20_CONFIG_CSR_LZ4_BLOCK_CHECKSUM_PRESENT_BITPOS, 141 139 ICP_QAT_HW_DECOMP_20_CONFIG_CSR_LZ4_BLOCK_CHECKSUM_PRESENT_MASK); 142 140 143 - return __builtin_bswap32(val32); 141 + return swab32(val32); 144 142 } 145 143 146 144 struct icp_qat_hw_decomp_20_config_csr_upper { ··· 160 158 ICP_QAT_HW_DECOMP_20_CONFIG_CSR_MINI_CAM_CONTROL_BITPOS, 161 159 ICP_QAT_HW_DECOMP_20_CONFIG_CSR_MINI_CAM_CONTROL_MASK); 162 160 163 - return __builtin_bswap32(val32); 161 + return swab32(val32); 164 162 } 165 163 166 164 #endif