Remove the redundant null pointer assignment and move
the features reset from wrapper caller to the get features
function to be consistent that dpif wrappers just call
the dpif class implemented callback and not doing
anything else.

CC: Justin Pettit <[email protected]>
Signed-off-by: Roi Dayan <[email protected]>
---

Notes:
    v2:
    - move memset from wrapper call

 lib/dpif-netlink.c | 2 +-
 lib/dpif.c         | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
index a620a6ec52dd..2bdd2137af36 100644
--- a/lib/dpif-netlink.c
+++ b/lib/dpif-netlink.c
@@ -4105,7 +4105,7 @@ dpif_netlink_meter_get_features(const struct dpif *dpif_,
                                 struct ofputil_meter_features *features)
 {
     if (probe_broken_meters(CONST_CAST(struct dpif *, dpif_))) {
-        features = NULL;
+        memset(features, 0, sizeof *features);
         return;
     }
 
diff --git a/lib/dpif.c b/lib/dpif.c
index 40f5fe44606e..f00aeea37428 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -1935,7 +1935,6 @@ void
 dpif_meter_get_features(const struct dpif *dpif,
                         struct ofputil_meter_features *features)
 {
-    memset(features, 0, sizeof *features);
     if (dpif->dpif_class->meter_get_features) {
         dpif->dpif_class->meter_get_features(dpif, features);
     }
-- 
2.38.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to