> -----Original Message-----
> From: Dmitry Antipov <[email protected]>
> Sent: Friday, October 20, 2023 12:10 PM
> To: Ping-Ke Shih <[email protected]>
> Cc: Tom Rix <[email protected]>; Kalle Valo <[email protected]>; [email protected]; Dmitry
> Antipov <[email protected]>
> Subject: [PATCH] [v2] wifi: rtw89: cleanup firmware elements parsing
>
> When compiling with clang-18, I've noticed the following:
>
> drivers/net/wireless/realtek/rtw89/fw.c:389:28: warning: cast to smaller
> integer type 'enum rtw89_fw_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> 389 | enum rtw89_fw_type type = (enum rtw89_fw_type)data;
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/wireless/realtek/rtw89/fw.c:569:13: warning: cast to smaller
> integer type 'enum rtw89_rf_path' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> 569 | rf_path = (enum rtw89_rf_path)data;
> | ^~~~~~~~~~~~~~~~~~~~~~~~
>
> So avoid brutal everything-to-const-void-and-back casts, introduce
> 'union rtw89_fw_element_arg' to pass parameters to element handler
> callbacks, and adjust all of the related bits accordingly. Compile
> tested only.
>
> Signed-off-by: Dmitry Antipov <[email protected]>
I take this patch locally, and performance looks as regular. Thanks.
Acked-and-tested-by: Ping-Ke Shih <[email protected]>