i40e: fix unrecognized FCOE EOF case

Because i40e_fcoe_ctxt_eof should never be called without
i40e_fcoe_eof_is_supported being called first, the EOF in fcoe_ctxt_eof
should always be valid and therefore we do not need to print an error
if it is not valid.

However, a WARN ON to easily catch any calls to i40e_fcoe_ctxt_eof that
aren't preceded with a call to i40e_fcoe_eof_is_supported is helpful.

Change-ID: I3b536b1981ec0bce80576a74440b7dea3908bdb9
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
Vasu Dev 2015-04-16 20:06:05 -04:00 committed by Jeff Kirsher
parent 6b02a174c1
commit 41837cad54

View file

@ -118,7 +118,7 @@ static inline int i40e_fcoe_fc_eof(struct sk_buff *skb, u8 *eof)
* *
* The FC EOF is converted to the value understood by HW for descriptor * The FC EOF is converted to the value understood by HW for descriptor
* programming. Never call this w/o calling i40e_fcoe_eof_is_supported() * programming. Never call this w/o calling i40e_fcoe_eof_is_supported()
* first. * first and that already checks for all supported valid eof values.
**/ **/
static inline u32 i40e_fcoe_ctxt_eof(u8 eof) static inline u32 i40e_fcoe_ctxt_eof(u8 eof)
{ {
@ -132,9 +132,12 @@ static inline u32 i40e_fcoe_ctxt_eof(u8 eof)
case FC_EOF_A: case FC_EOF_A:
return I40E_TX_DESC_CMD_L4T_EOFT_EOF_A; return I40E_TX_DESC_CMD_L4T_EOFT_EOF_A;
default: default:
/* FIXME: still returns 0 */ /* Supported valid eof shall be already checked by
pr_err("Unrecognized EOF %x\n", eof); * calling i40e_fcoe_eof_is_supported() first,
return 0; * therefore this default case shall never hit.
*/
WARN_ON(1);
return -EINVAL;
} }
} }