[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1587575340-6790-4-git-send-email-xiangxia.m.yue@gmail.com>
Date: Thu, 23 Apr 2020 01:08:58 +0800
From: xiangxia.m.yue@...il.com
To: pshelar@....org, azhou@....org, blp@....org, u9012063@...il.com
Cc: netdev@...r.kernel.org, dev@...nvswitch.org,
Tonghao Zhang <xiangxia.m.yue@...il.com>
Subject: [PATCH net-next v3 3/5] net: openvswitch: remove the unnecessary check
From: Tonghao Zhang <xiangxia.m.yue@...il.com>
Before invoking the ovs_meter_cmd_reply_stats, "meter"
was checked, so don't check it agin in that function.
Cc: Pravin B Shelar <pshelar@....org>
Cc: Andy Zhou <azhou@....org>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@...il.com>
---
net/openvswitch/meter.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index 372f4565872d..b7893b0d6423 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -242,12 +242,11 @@ static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id,
if (nla_put_u32(reply, OVS_METER_ATTR_ID, meter_id))
goto error;
- if (!meter)
- return 0;
-
if (nla_put(reply, OVS_METER_ATTR_STATS,
- sizeof(struct ovs_flow_stats), &meter->stats) ||
- nla_put_u64_64bit(reply, OVS_METER_ATTR_USED, meter->used,
+ sizeof(struct ovs_flow_stats), &meter->stats))
+ goto error;
+
+ if (nla_put_u64_64bit(reply, OVS_METER_ATTR_USED, meter->used,
OVS_METER_ATTR_PAD))
goto error;
--
2.23.0
Powered by blists - more mailing lists