net/ice: fixed wrong return value

Message ID 20190709040812.4191-1-qiming.yang@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Qi Zhang
Headers
Series net/ice: fixed wrong return value |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Qiming Yang July 9, 2019, 4:08 a.m. UTC
  Fixed error return value check and wrong error message.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/ice_generic_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon July 10, 2019, 7:29 a.m. UTC | #1
Hi,

09/07/2019 06:08, Qiming Yang:
> Fixed error return value check and wrong error message.
> 
> Fixes: d76116a4678f ("net/ice: add generic flow API")
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>

Comments about the formatting of the title:

The verb must be in infinitive form: "fix".

The title must say which behaviour is fixed,
not the code detail (we don't care in the title
if it because of a return value or variable assignment).
Here it is about fixing flow rule validation, right?

One more thing, the word "wrong" can always be avoided
after "fix", because we know you are not fixing something
which worked perfectly :)

Do not hesitate to share these tips around you.
Thank you
  
Qiming Yang July 11, 2019, 2:58 a.m. UTC | #2
Hi, Thomas
Thanks for the comments. Will change it.

Qiming
-----Original Message-----
From: Thomas Monjalon [mailto:thomas@monjalon.net] 
Sent: Wednesday, July 10, 2019 3:30 PM
To: Yang, Qiming <qiming.yang@intel.com>
Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/ice: fixed wrong return value

Hi,

09/07/2019 06:08, Qiming Yang:
> Fixed error return value check and wrong error message.
> 
> Fixes: d76116a4678f ("net/ice: add generic flow API")
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>

Comments about the formatting of the title:

The verb must be in infinitive form: "fix".

The title must say which behaviour is fixed, not the code detail (we don't care in the title if it because of a return value or variable assignment).
Here it is about fixing flow rule validation, right?

One more thing, the word "wrong" can always be avoided after "fix", because we know you are not fixing something which worked perfectly :)

Do not hesitate to share these tips around you.
Thank you
  

Patch

diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index d5ff278..e6a2c4b 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -549,7 +549,7 @@  static int ice_flow_valid_action(struct rte_eth_dev *dev,
 			rte_flow_error_set(error, EINVAL,
 					   RTE_FLOW_ERROR_TYPE_ACTION,
 					   actions, "Invalid queue ID for"
-					   " ethertype_filter.");
+					   " switch filter.");
 			return -rte_errno;
 		}
 		break;
@@ -596,7 +596,7 @@  ice_flow_validate(struct rte_eth_dev *dev,
 	}
 
 	ret = ice_flow_valid_attr(attr, error);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	inset = ice_flow_valid_pattern(pattern, error);