[ovs-dev] [PATCH 10/15] sflow: Don't assign value that is never used.

Ben Pfaff blp at nicira.com
Wed Feb 10 19:30:33 UTC 2010


The "error" return from collectors_create() is actually not that
interesting, because there could still be some collectors configured
properly anyhow, so we might as well discard the error return here,
without even assigning it to a variable.

Found by Clang (http://clang-analyzer.llvm.org/).
---
 ofproto/ofproto-sflow.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c
index 1b659d1..44c94a1 100644
--- a/ofproto/ofproto-sflow.c
+++ b/ofproto/ofproto-sflow.c
@@ -367,7 +367,6 @@ ofproto_sflow_set_options(struct ofproto_sflow *os,
     unsigned int odp_port;
     SFLAddress agentIP;
     time_t now;
-    int error;
 
     if (!options->targets.n || !options->sampling_rate) {
         /* No point in doing any work if there are no targets or nothing to
@@ -385,8 +384,8 @@ ofproto_sflow_set_options(struct ofproto_sflow *os,
     if (options_changed
         || collectors_count(os->collectors) < options->targets.n) {
         collectors_destroy(os->collectors);
-        error = collectors_create(&options->targets,
-                                  SFL_DEFAULT_COLLECTOR_PORT, &os->collectors);
+        collectors_create(&options->targets, SFL_DEFAULT_COLLECTOR_PORT,
+                          &os->collectors);
         if (os->collectors == NULL) {
             VLOG_WARN_RL(&rl, "no collectors could be initialized, "
                          "sFlow disabled");
-- 
1.6.6.1





More information about the dev mailing list