net/ice: clean up redundant assignment and indentations

The patch removes redundant code and cleans up some wrong indentations.

Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
This commit is contained in:
Ying A Wang 2019-10-17 02:33:52 +08:00 committed by Ferruh Yigit
parent c3ff0ac70a
commit 23ecda2aa5

View File

@ -44,21 +44,21 @@ const struct rte_flow_ops ice_flow_ops = {
static int static int
ice_flow_valid_attr(const struct rte_flow_attr *attr, ice_flow_valid_attr(const struct rte_flow_attr *attr,
struct rte_flow_error *error) struct rte_flow_error *error)
{ {
/* Must be input direction */ /* Must be input direction */
if (!attr->ingress) { if (!attr->ingress) {
rte_flow_error_set(error, EINVAL, rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_INGRESS, RTE_FLOW_ERROR_TYPE_ATTR_INGRESS,
attr, "Only support ingress."); attr, "Only support ingress.");
return -rte_errno; return -rte_errno;
} }
/* Not supported */ /* Not supported */
if (attr->egress) { if (attr->egress) {
rte_flow_error_set(error, EINVAL, rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
attr, "Not support egress."); attr, "Not support egress.");
return -rte_errno; return -rte_errno;
} }
@ -73,8 +73,8 @@ ice_flow_valid_attr(const struct rte_flow_attr *attr,
/* Not supported */ /* Not supported */
if (attr->group) { if (attr->group) {
rte_flow_error_set(error, EINVAL, rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ATTR_GROUP, RTE_FLOW_ERROR_TYPE_ATTR_GROUP,
attr, "Not support group."); attr, "Not support group.");
return -rte_errno; return -rte_errno;
} }
@ -102,7 +102,7 @@ ice_find_first_item(const struct rte_flow_item *item, bool is_void)
/* Skip all VOID items of the pattern */ /* Skip all VOID items of the pattern */
static void static void
ice_pattern_skip_void_item(struct rte_flow_item *items, ice_pattern_skip_void_item(struct rte_flow_item *items,
const struct rte_flow_item *pattern) const struct rte_flow_item *pattern)
{ {
uint32_t cpy_count = 0; uint32_t cpy_count = 0;
const struct rte_flow_item *pb = pattern, *pe = pattern; const struct rte_flow_item *pb = pattern, *pe = pattern;
@ -124,7 +124,6 @@ ice_pattern_skip_void_item(struct rte_flow_item *items,
items += cpy_count; items += cpy_count;
if (pe->type == RTE_FLOW_ITEM_TYPE_END) { if (pe->type == RTE_FLOW_ITEM_TYPE_END) {
pb = pe;
break; break;
} }
@ -560,10 +559,10 @@ static int ice_flow_valid_action(struct rte_eth_dev *dev,
static int static int
ice_flow_validate(struct rte_eth_dev *dev, ice_flow_validate(struct rte_eth_dev *dev,
const struct rte_flow_attr *attr, const struct rte_flow_attr *attr,
const struct rte_flow_item pattern[], const struct rte_flow_item pattern[],
const struct rte_flow_action actions[], const struct rte_flow_action actions[],
struct rte_flow_error *error) struct rte_flow_error *error)
{ {
uint64_t inset = 0; uint64_t inset = 0;
int ret = ICE_ERR_NOT_SUPPORTED; int ret = ICE_ERR_NOT_SUPPORTED;
@ -609,10 +608,10 @@ ice_flow_validate(struct rte_eth_dev *dev,
static struct rte_flow * static struct rte_flow *
ice_flow_create(struct rte_eth_dev *dev, ice_flow_create(struct rte_eth_dev *dev,
const struct rte_flow_attr *attr, const struct rte_flow_attr *attr,
const struct rte_flow_item pattern[], const struct rte_flow_item pattern[],
const struct rte_flow_action actions[], const struct rte_flow_action actions[],
struct rte_flow_error *error) struct rte_flow_error *error)
{ {
struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
struct rte_flow *flow = NULL; struct rte_flow *flow = NULL;
@ -647,8 +646,8 @@ free_flow:
static int static int
ice_flow_destroy(struct rte_eth_dev *dev, ice_flow_destroy(struct rte_eth_dev *dev,
struct rte_flow *flow, struct rte_flow *flow,
struct rte_flow_error *error) struct rte_flow_error *error)
{ {
struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
int ret = 0; int ret = 0;
@ -669,7 +668,7 @@ ice_flow_destroy(struct rte_eth_dev *dev,
static int static int
ice_flow_flush(struct rte_eth_dev *dev, ice_flow_flush(struct rte_eth_dev *dev,
struct rte_flow_error *error) struct rte_flow_error *error)
{ {
struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
struct rte_flow *p_flow; struct rte_flow *p_flow;