summaryrefslogtreecommitdiffstats
path: root/sys/dev/ntb
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2016-08-18 09:17:39 +0000
committermav <mav@FreeBSD.org>2016-08-18 09:17:39 +0000
commit730a180c4fa15d03cb801f73a22c40c1dfc32aea (patch)
treee0cba40642fc33d27b4004dd2d916943ad1c05a5 /sys/dev/ntb
parent9e98ad7c6697802dd5c7af27d5939938b6ec269c (diff)
downloadFreeBSD-src-730a180c4fa15d03cb801f73a22c40c1dfc32aea.zip
FreeBSD-src-730a180c4fa15d03cb801f73a22c40c1dfc32aea.tar.gz
MFC r302483: Remove some dead code found by Clang static analyzer.
Diffstat (limited to 'sys/dev/ntb')
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw.c b/sys/dev/ntb/ntb_hw/ntb_hw.c
index bfa3559..0e257bb 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw.c
@@ -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_ARGS)
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_ARGS)
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_HANDLER_ARGS)
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));
OpenPOWER on IntegriCloud