]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
qed: Avoid constant logical operation warning in qed_vf_pf_acquire
authorNathan Chancellor <natechancellor@gmail.com>
Mon, 24 Sep 2018 22:17:03 +0000 (15:17 -0700)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:54:47 +0000 (19:54 -0600)
commit71e837a8f016140b2e40fbf086a261d3cd1c4d1b
treea7a28f52a3cee7908b38a7d143eaab54ad990022
parent984373d8f567795349b3d1730ea9b10aa1c00cb4
qed: Avoid constant logical operation warning in qed_vf_pf_acquire

BugLink: https://bugs.launchpad.net/bugs/1836654
[ Upstream commit 1c492a9d55ba99079210ed901dd8a5423f980487 ]

Clang warns when a constant is used in a boolean context as it thinks a
bitwise operation may have been intended.

drivers/net/ethernet/qlogic/qed/qed_vf.c:415:27: warning: use of logical
'&&' with constant operand [-Wconstant-logical-operand]
        if (!p_iov->b_pre_fp_hsi &&
                                 ^
drivers/net/ethernet/qlogic/qed/qed_vf.c:415:27: note: use '&' for a
bitwise operation
        if (!p_iov->b_pre_fp_hsi &&
                                 ^~
                                 &
drivers/net/ethernet/qlogic/qed/qed_vf.c:415:27: note: remove constant
to silence this warning
        if (!p_iov->b_pre_fp_hsi &&
                                ~^~
1 warning generated.

This has been here since commit 1fe614d10f45 ("qed: Relax VF firmware
requirements") and I am not entirely sure why since 0 isn't a special
case. Just remove the statement causing Clang to warn since it isn't
required.

Link: https://github.com/ClangBuiltLinux/linux/issues/126
Signed-off-by: Nathan Chancellor <natechancellor@gmail.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: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/qlogic/qed/qed_vf.c