Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Aug 2016 09:17:39 +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-11@freebsd.org
Subject:   svn commit: r304345 - stable/11/sys/dev/ntb/ntb_hw
Message-ID:  <201608180917.u7I9Hdxt089682@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Aug 18 09:17:39 2016
New Revision: 304345
URL: https://svnweb.freebsd.org/changeset/base/304345

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

Modified:
  stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c
==============================================================================
--- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c	Thu Aug 18 09:16:59 2016	(r304344)
+++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c	Thu Aug 18 09:17:39 2016	(r304345)
@@ -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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608180917.u7I9Hdxt089682>