Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eth: linkdata: sxevf: Fix wrong logic in 'sxevf_mailbox_lock'
SXE_VFMAILBOX_VFU is just a bitmask. We need to perform a bitwise AND operation between this bitmask and the returned register value to determine if the specific flags are set successfully. Fix follow error with clang-19: drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_msg.c:107:30: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand] 107 | if (sxevf_mbx_reg_read(hw) && SXE_VFMAILBOX_VFU) { | ^ ~~~~~~~~~~~~~~~~~ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_msg.c:107:30: note: use '&' for a bitwise operation 107 | if (sxevf_mbx_reg_read(hw) && SXE_VFMAILBOX_VFU) { | ^~ | & drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_msg.c:107:30: note: remove constant to silence this warning 107 | if (sxevf_mbx_reg_read(hw) && SXE_VFMAILBOX_VFU) { | ^~~~~~~~~~~~~~~~~~~~ 1 error generated. Signed-off-by: WangYuli <[email protected]>
- Loading branch information