]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Address the error "Dead assignment" of static analysif
authorHung-Weic Chiu <sppsorrg@gmail.com>
Wed, 10 May 2017 02:51:28 +0000 (02:51 +0000)
committerQuentin Young <qlyoung@users.noreply.github.com>
Wed, 10 May 2017 20:02:48 +0000 (16:02 -0400)
- Refer to https://ci1.netdef.org/browse/FRR-FRR4-44/artifact/shared/static_analysis/index.html
- Remove unused variable

Signed-off-by: Hung-Weic Chiu <sppsorrg@gmail.com>
bgpd/bgp_btoa.c
bgpd/bgpd.c
bgpd/rfapi/rfapi_rib.c
isisd/isis_pdu.c
ospfd/ospf_flood.c
ospfd/ospf_te.c
ripd/ripd.c
ripngd/ripngd.c
zebra/label_manager.c

index 37bef9b85d7267cae764e45bcdc6a0a98f74246b..d3162a4ea52e52850a5b0540a57c03a77e8b5115 100644 (file)
@@ -238,7 +238,7 @@ main (int argc, char **argv)
 
       printf ("len: %zd\n", len);
 
-      ret = fread (s->data + 12, len, 1, fp);
+      fread (s->data + 12, len, 1, fp);
       if (feof (fp))
        {
          printf ("ENDOF FILE 2\n");
index 20013bc00566a6e582d1a3bb19def4ba4ff35b4d..2c04f79478d2003fdd79f4adbc2cb8f4ce0a8cbd 100644 (file)
@@ -6129,7 +6129,7 @@ peer_ttl_security_hops_set (struct peer *peer, int gtsm_hops)
               * min & max ttls on the socket. The return value is
               * irrelevant.
               */
-             ret = peer_ebgp_multihop_set (peer, MAXTTL);
+             peer_ebgp_multihop_set (peer, MAXTTL);
            }
        }
     }
index b59db3ab562cad4006d2c070af72b40af97d3a04..85ac936818ea0465f5c3c3415e399a553fcf0f09 100644 (file)
@@ -1307,7 +1307,6 @@ callback:
       if (!printedprefix)
         {
           vnc_zlog_debug_verbose ("%s: For prefix %s (d)", __func__, buf_prefix);
-          printedprefix = 1;
         }
       vnc_zlog_debug_verbose ("%s: delete_list has %d elements",
                   __func__, delete_list->count);
index f13a2f30eaab72fa913b5417b272d63c8fa86f44..bca3f91d4ed992988a1e4c38ca2373a0543aa0a9 100644 (file)
@@ -1405,7 +1405,6 @@ process_lsp (int level, struct isis_circuit *circuit, const u_char *ssnpa)
              ((level == IS_LEVEL_2) &&
               (circuit->u.p2p.neighbor->adj_usage == ISIS_ADJ_LEVEL1)))
            return ISIS_WARNING;        /* Silently discard */
-         adj = circuit->u.p2p.neighbor;
        }
     }
 
index 417a7aa8d2750a9c2e31943c6e4f1e3109d536c5..4cc28f74861ee5d464caf2e498f72707e483289d 100644 (file)
@@ -260,7 +260,6 @@ ospf_flood (struct ospf *ospf, struct ospf_neighbor *nbr,
                (void *)current,
                dump_lsa_key (new));
 
-  lsa_ack_flag = 0;
   oi = nbr->oi;
 
   /* If there is already a database copy, and if the
index 449f9e7b97f7f7767bc529c6052f5bba9c1a4b0f..a89d67c6bbe03841b8bb0d6bb414177a26a5d251 100644 (file)
@@ -1480,12 +1480,12 @@ ospf_mpls_te_lsa_originate_as (void *arg)
       if (IS_FLOOD_AS (lp->type))
         {
           top = (struct ospf *) arg;
-          rc = ospf_mpls_te_lsa_originate2 (top, lp);
+          ospf_mpls_te_lsa_originate2 (top, lp);
         }
       else
         {
           area = (struct ospf_area *) arg;
-          rc = ospf_mpls_te_lsa_originate1 (area, lp);
+          ospf_mpls_te_lsa_originate1 (area, lp);
         }
     }
 
index e9e83a1c7fa17628be7b97edf4fdee6594346e56..4a42aff78f040851882ce67a769da7d5a3be065e 100644 (file)
@@ -2398,7 +2398,6 @@ rip_output_process (struct connected *ifc, struct sockaddr_in *to,
       if (ret >= 0 && IS_RIP_DEBUG_SEND)
        rip_packet_dump ((struct rip_packet *)STREAM_DATA (s),
                         stream_get_endp (s), "SEND");
-      num = 0;
       stream_reset (s);
     }
 
index e65d0b16076a756ecbcfa12f24fd12684b62e7bf..399435fb2458e74ad770bf07e95618d77834ef87 100644 (file)
@@ -970,11 +970,11 @@ ripng_redistribute_add (int type, int sub_type, struct prefix_ipv6 *p,
        }
       }
 
-      rinfo = ripng_ecmp_replace (&newinfo);
+      ripng_ecmp_replace (&newinfo);
       route_unlock_node (rp);
     }
   else
-    rinfo = ripng_ecmp_add (&newinfo);
+    ripng_ecmp_add (&newinfo);
 
   if (IS_RIPNG_DEBUG_EVENT) {
     if (!nexthop)
@@ -2020,11 +2020,11 @@ DEFUN (show_ipv6_ripng,
          p = (struct prefix_ipv6 *) &rp->p;
 
 #ifdef DEBUG
-         len = vty_out (vty, "R(a) %d/%d %s/%d ",
+         vty_out (vty, "R(a) %d/%d %s/%d ",
                         aggregate->count, aggregate->suppress,
                         inet6_ntoa (p->prefix), p->prefixlen);
 #else
-         len = vty_out (vty, "R(a) %s/%d ", 
+         vty_out (vty, "R(a) %s/%d ",
                         inet6_ntoa (p->prefix), p->prefixlen);
 #endif /* DEBUG */
          vty_out (vty, "%s", VTY_NEWLINE);
@@ -2042,13 +2042,13 @@ DEFUN (show_ipv6_ripng,
          p = (struct prefix_ipv6 *) &rp->p;
 
 #ifdef DEBUG
-         len = vty_out (vty, "%c(%s) 0/%d %s/%d ",
+         vty_out (vty, "%c(%s) 0/%d %s/%d ",
                         zebra_route_char(rinfo->type),
                         ripng_route_subtype_print(rinfo),
                         rinfo->suppress,
                         inet6_ntoa (p->prefix), p->prefixlen);
 #else
-         len = vty_out (vty, "%c(%s) %s/%d ",
+         vty_out (vty, "%c(%s) %s/%d ",
                         zebra_route_char(rinfo->type),
                         ripng_route_subtype_print(rinfo),
                         inet6_ntoa (p->prefix), p->prefixlen);
index f7d2dce8f36277ef02c70c405a42b7ac7d4f7c9e..e60f7a4a6af21af75bebe64d7cea416eb09d4e02 100644 (file)
@@ -204,7 +204,6 @@ struct label_manager_chunk *assign_label_chunk(u_char proto, u_short instance,
        struct label_manager_chunk *lmc;
        struct listnode *node;
 
-       node = lbl_mgr.lc_list->head;
        /* first check if there's one available */
        for (ALL_LIST_ELEMENTS_RO(lbl_mgr.lc_list, node, lmc)) {
                if (lmc->proto == NO_PROTO && lmc->end - lmc->start + 1 == size) {