Author: mav
Date: Sat Jul  9 09:47:11 2016
New Revision: 302483
URL: https://svnweb.freebsd.org/changeset/base/302483

Log:
  Remove some dead code found by Clang static analyzer.

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw.c

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c
==============================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw.c    Sat Jul  9 09:34:24 2016        
(r302482)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw.c    Sat Jul  9 09:47:11 2016        
(r302483)
@@ -1352,8 +1352,6 @@ ntb_get_msix_info(struct ntb_softc *ntb)
        dinfo = device_get_ivars(ntb->device);
        msix = &dinfo->cfg.msix;
 
-       laddr = data = 0;
-
        CTASSERT(XEON_NONLINK_DB_MSIX_BITS == nitems(ntb->msix_data));
 
        for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) {
@@ -2587,13 +2585,10 @@ ntb_sysctl_init(struct ntb_softc *ntb)
 static int
 sysctl_handle_features(SYSCTL_HANDLER_ARGS)
 {
-       struct ntb_softc *ntb;
+       struct ntb_softc *ntb = arg1;
        struct sbuf sb;
        int error;
 
-       error = 0;
-       ntb = arg1;
-
        sbuf_new_for_sysctl(&sb, NULL, 256, req);
 
        sbuf_printf(&sb, "%b", ntb->features, NTB_FEATURES_STR);
@@ -2608,13 +2603,10 @@ sysctl_handle_features(SYSCTL_HANDLER_AR
 static int
 sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS)
 {
-       struct ntb_softc *ntb;
+       struct ntb_softc *ntb = arg1;
        unsigned old, new;
        int error;
 
-       error = 0;
-       ntb = arg1;
-
        old = ntb_link_enabled(ntb);
 
        error = SYSCTL_OUT(req, &old, sizeof(old));
@@ -2638,15 +2630,12 @@ sysctl_handle_link_admin(SYSCTL_HANDLER_
 static int
 sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS)
 {
-       struct ntb_softc *ntb;
+       struct ntb_softc *ntb = arg1;
        struct sbuf sb;
        enum ntb_speed speed;
        enum ntb_width width;
        int error;
 
-       error = 0;
-       ntb = arg1;
-
        sbuf_new_for_sysctl(&sb, NULL, 32, req);
 
        if (ntb_link_is_up(ntb, &speed, &width))
@@ -2666,13 +2655,10 @@ sysctl_handle_link_status_human(SYSCTL_H
 static int
 sysctl_handle_link_status(SYSCTL_HANDLER_ARGS)
 {
-       struct ntb_softc *ntb;
+       struct ntb_softc *ntb = arg1;
        unsigned res;
        int error;
 
-       error = 0;
-       ntb = arg1;
-
        res = ntb_link_is_up(ntb, NULL, NULL);
 
        error = SYSCTL_OUT(req, &res, sizeof(res));
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to