]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
qed: Avoid implicit enum conversion in qed_ooo_submit_tx_buffers
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 4 Oct 2018 16:39:20 +0000 (09:39 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 28 Nov 2019 04:59:27 +0000 (23:59 -0500)
commite10e3b4cf5b8d0ff0e810247d8d76b89e63bc84e
treeb327ce37d2f8292b462620f32809e4a7e3eaa5f7
parent9c3e0b6a8133236f673be5bae204b2d4e5243566
qed: Avoid implicit enum conversion in qed_ooo_submit_tx_buffers

BugLink: https://bugs.launchpad.net/bugs/1854216
[ Upstream commit 8fa74e3c49204bdf788d99ef71840490cccc210d ]

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@cavium.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/qlogic/qed/qed_ll2.c