staging: rtl8723au: remove unnecessary le32_to_cpu
PATCH 1/1 staging: rtl8723au: remove unnecessary le32_to_cpu
The values passed to le32_to_cpu are already in the correct byte order. This fixes four "cast to restricted __le32" sparse warnings.
Signed-off-by Michał Bartoszkiewicz <[email protected]>
--- drivers/staging/rtl8723au/core/rtw_security.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8723au/core/rtw_security.c +4 -4
@@ -245,8 +245,8 @@ void rtw_wep_decrypt23a(struct rtw_adapter *padapter,arcfour_encrypt (&mycontext, payload, payload, length);/* calculate icv and compare the icv */ - actual_crc =le32_to_cpu (getcrc32 (payload, length -4 )); - expected_crc =le32_to_cpu (get_unaligned_le32 (&payload[length -4 ])); + actual_crc =getcrc32 (payload, length -4 ); + expected_crc =get_unaligned_le32 (&payload[length -4 ]);if (actual_crc != expected_crc) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
@@ -773,8 +773,8 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter,arcfour_init (&mycontext, rc4key,16 );arcfour_encrypt (&mycontext, payload, payload, length); - actual_crc =le32_to_cpu (getcrc32 (payload, length -4 )); - expected_crc =le32_to_cpu (get_unaligned_le32 (&payload[length -4 ])); + actual_crc =getcrc32 (payload, length -4 ); + expected_crc =get_unaligned_le32 (&payload[length -4 ]);if (actual_crc != expected_crc) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
Signature · 1 line
2.5.1
Quoted 7 lines · Michał Bartoszkiewicz
The values passed to
le32_to_cpuare already in the correct byte order. This fixes four "cast to restricted__le32" sparse warnings.Signed-off-by Michał Bartoszkiewicz <[email protected]>--- drivers/staging/rtl8723au/core/rtw_security.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Sounds OK to me - the fact we never hit problems with this is a good indicator the hw crypt functions work.
Cheers,
Jes
Quoted 27 lines
drivers/staging/rtl8723au/core/rtw_security.c +4
-4@@ -245,8 +245,8 @@ void rtw_wep_decrypt23a(struct rtw_adapter *padapter,arcfour_encrypt (&mycontext, payload, payload, length);/* calculate icv and compare the icv */ - actual_crc =le32_to_cpu (getcrc32 (payload, length -4 )); - expected_crc =le32_to_cpu (get_unaligned_le32 (&payload[length -4 ])); + actual_crc =getcrc32 (payload, length -4 ); + expected_crc =get_unaligned_le32 (&payload[length -4 ]);if (actual_crc != expected_crc) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_,@@ -773,8 +773,8 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter,arcfour_init (&mycontext, rc4key,16 );arcfour_encrypt (&mycontext, payload, payload, length); - actual_crc =le32_to_cpu (getcrc32 (payload, length -4 )); - expected_crc =le32_to_cpu (get_unaligned_le32 (&payload[length -4 ])); + actual_crc =getcrc32 (payload, length -4 ); + expected_crc =get_unaligned_le32 (&payload[length -4 ]);if (actual_crc != expected_crc) { RT_TRACE(_module_rtl871x_security_c_, _drv_err_,