Date: Thu, 18 Aug 2016 10:25:07 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304377 - stable/10/sys/dev/ntb/ntb_hw Message-ID: <201608181025.u7IAP7XO018470@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Aug 18 10:25:07 2016 New Revision: 304377 URL: https://svnweb.freebsd.org/changeset/base/304377 Log: MFC r302483: Remove some dead code found by Clang static analyzer. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:24:31 2016 (r304376) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:25:07 2016 (r304377) @@ -1366,8 +1366,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++) { @@ -2606,13 +2604,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); @@ -2627,13 +2622,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)); @@ -2657,15 +2649,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)) @@ -2685,13 +2674,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));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608181025.u7IAP7XO018470>