RE: [PATCH v2] qed: Avoid implicit enum conversion in qed_ooo_submit_tx_buffers

From: Tayar, Tomer
Date: Thu Oct 04 2018 - 12:46:36 EST


From: Nathan Chancellor <natechancellor@xxxxxxxxx>
Sent: Thursday, October 04, 2018 7:39 PM

> Clang warns when one enumerated type is implicitly converted to another.
>
> drivers/net/ethernet/qlogic/qed/qed_ll2.c:799:32: warning: implicit
> conversion from enumeration type 'enum core_tx_dest' to different
> enumeration type 'enum qed_ll2_tx_dest' [-Wenum-conversion]
> tx_pkt.tx_dest = p_ll2_conn->tx_dest;
> ~ ~~~~~~~~~~~~^~~~~~~
> 1 warning generated.
>
> Fix this by using a switch statement to convert between the enumerated
> values since they are not 1 to 1, which matches how the rest of the
> driver handles this conversion.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/125
> Suggested-by: Tomer Tayar <Tomer.Tayar@xxxxxxxxxx>
> Signed-off-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
> ---
>
> v1 -> v2:
>
> * Use an explicit switch statement to convert between the enumerated
> types like the rest of the driver, as suggested by Tomer.

Thanks
Acked-by: Tomer Tayar <Tomer.Tayar@xxxxxxxxxx>