diff mbox series

[net-next,1/2] wifi: ath11k: fix Wvoid-pointer-to-enum-cast warning

Message ID 20230810091224.70088-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State Accepted
Commit 6763ef191d672ff3c2db0622652d49b0c0a60c4a
Delegated to: Kalle Valo
Headers show
Series [net-next,1/2] wifi: ath11k: fix Wvoid-pointer-to-enum-cast warning | expand

Commit Message

Krzysztof Kozlowski Aug. 10, 2023, 9:12 a.m. UTC
'hw_rev' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  h11k/ahb.c:1124:11: error: cast to smaller integer type 'enum ath11k_hw_rev' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/net/wireless/ath/ath11k/ahb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Johnson Aug. 10, 2023, 1:36 p.m. UTC | #1
On 8/10/2023 2:12 AM, Krzysztof Kozlowski wrote:
> 'hw_rev' is an enum, thus cast of pointer on 64-bit compile test with W=1
> causes:
> 
>    h11k/ahb.c:1124:11: error: cast to smaller integer type 'enum ath11k_hw_rev' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>

> ---
>   drivers/net/wireless/ath/ath11k/ahb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
> index 139da578831a..ada4d68c7421 100644
> --- a/drivers/net/wireless/ath/ath11k/ahb.c
> +++ b/drivers/net/wireless/ath/ath11k/ahb.c
> @@ -1121,7 +1121,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
>   		return -EINVAL;
>   	}
>   
> -	hw_rev = (enum ath11k_hw_rev)of_id->data;
> +	hw_rev = (uintptr_t)of_id->data;
>   
>   	switch (hw_rev) {
>   	case ATH11K_HW_IPQ8074:
Kalle Valo Aug. 22, 2023, 12:58 p.m. UTC | #2
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> writes:

> 'hw_rev' is an enum, thus cast of pointer on 64-bit compile test with W=1
> causes:
>
>   h11k/ahb.c:1124:11: error: cast to smaller integer type 'enum ath11k_hw_rev' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

ath11k patches go to my ath.git tree, not net-next. But no need to
resend because of this.
Kalle Valo Aug. 23, 2023, 2:10 p.m. UTC | #3
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> 'hw_rev' is an enum, thus cast of pointer on 64-bit compile test with W=1
> causes:
> 
>   h11k/ahb.c:1124:11: error: cast to smaller integer type 'enum ath11k_hw_rev' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

2 patches applied to ath-next branch of ath.git, thanks.

6763ef191d67 wifi: ath11k: fix Wvoid-pointer-to-enum-cast warning
de43b07db2a1 wifi: ath10k: fix Wvoid-pointer-to-enum-cast warning
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 139da578831a..ada4d68c7421 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1121,7 +1121,7 @@  static int ath11k_ahb_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	hw_rev = (enum ath11k_hw_rev)of_id->data;
+	hw_rev = (uintptr_t)of_id->data;
 
 	switch (hw_rev) {
 	case ATH11K_HW_IPQ8074: