From owner-svn-src-all@freebsd.org Sat Oct 21 19:34:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CBE7E38236; Sat, 21 Oct 2017 19:34:56 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06ACC682E6; Sat, 21 Oct 2017 19:34:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LJYtU1019512; Sat, 21 Oct 2017 19:34:55 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LJYsmW019509; Sat, 21 Oct 2017 19:34:55 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201710211934.v9LJYsmW019509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 21 Oct 2017 19:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r324831 - in stable/11: lib/libnv sys/contrib/libnv X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in stable/11: lib/libnv sys/contrib/libnv X-SVN-Commit-Revision: 324831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 19:34:56 -0000 Author: oshogbo Date: Sat Oct 21 19:34:54 2017 New Revision: 324831 URL: https://svnweb.freebsd.org/changeset/base/324831 Log: MFC r323851: Remove redundant initialization. Don't use variable - just return the value. Make scan-build happy by casting to 'void *' instead of 'void **'. Submitted by: pjd@ Found by: scan-build and cppcheck Sponsored by: Wheel Systems Modified: stable/11/lib/libnv/msgio.c stable/11/sys/contrib/libnv/nvlist.c stable/11/sys/contrib/libnv/nvpair.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libnv/msgio.c ============================================================================== --- stable/11/lib/libnv/msgio.c Sat Oct 21 19:33:31 2017 (r324830) +++ stable/11/lib/libnv/msgio.c Sat Oct 21 19:34:54 2017 (r324831) @@ -299,7 +299,6 @@ fd_package_recv(int sock, int *fds, size_t nfds) PJDLOG_ASSERT(nfds > 0); PJDLOG_ASSERT(fds != NULL); - i = 0; bzero(&msg, sizeof(msg)); bzero(&iov, sizeof(iov)); Modified: stable/11/sys/contrib/libnv/nvlist.c ============================================================================== --- stable/11/sys/contrib/libnv/nvlist.c Sat Oct 21 19:33:31 2017 (r324830) +++ stable/11/sys/contrib/libnv/nvlist.c Sat Oct 21 19:34:54 2017 (r324831) @@ -281,8 +281,7 @@ nvlist_get_pararr(const nvlist_t *nvl, void **cookiep) return (ret); } - ret = nvlist_get_parent(nvl, cookiep); - return (ret); + return (nvlist_get_parent(nvl, cookiep)); } bool @@ -710,7 +709,6 @@ static int * nvlist_xdescriptors(const nvlist_t *nvl, int *descs) { nvpair_t *nvp; - const char *name; int type; NVLIST_ASSERT(nvl); @@ -718,7 +716,7 @@ nvlist_xdescriptors(const nvlist_t *nvl, int *descs) nvp = NULL; do { - while ((name = nvlist_next(nvl, &type, (void**)&nvp)) != NULL) { + while (nvlist_next(nvl, &type, (void *)&nvp) != NULL) { switch (type) { case NV_TYPE_DESCRIPTOR: *descs = nvpair_get_descriptor(nvp); @@ -757,7 +755,7 @@ nvlist_xdescriptors(const nvlist_t *nvl, int *descs) } } } - } while ((nvl = nvlist_get_pararr(nvl, (void**)&nvp)) != NULL); + } while ((nvl = nvlist_get_pararr(nvl, (void *)&nvp)) != NULL); return (descs); } @@ -788,7 +786,6 @@ nvlist_ndescriptors(const nvlist_t *nvl) { #ifndef _KERNEL nvpair_t *nvp; - const char *name; size_t ndescs; int type; @@ -798,7 +795,7 @@ nvlist_ndescriptors(const nvlist_t *nvl) ndescs = 0; nvp = NULL; do { - while ((name = nvlist_next(nvl, &type, (void**)&nvp)) != NULL) { + while (nvlist_next(nvl, &type, (void *)&nvp) != NULL) { switch (type) { case NV_TYPE_DESCRIPTOR: ndescs++; @@ -831,7 +828,7 @@ nvlist_ndescriptors(const nvlist_t *nvl) } } } - } while ((nvl = nvlist_get_pararr(nvl, (void**)&nvp)) != NULL); + } while ((nvl = nvlist_get_pararr(nvl, (void *)&nvp)) != NULL); return (ndescs); #else @@ -1260,7 +1257,6 @@ nvlist_send(int sock, const nvlist_t *nvl) return (-1); ret = -1; - data = NULL; fdidx = 0; data = nvlist_xpack(nvl, &fdidx, &datasize); Modified: stable/11/sys/contrib/libnv/nvpair.c ============================================================================== --- stable/11/sys/contrib/libnv/nvpair.c Sat Oct 21 19:33:31 2017 (r324830) +++ stable/11/sys/contrib/libnv/nvpair.c Sat Oct 21 19:34:54 2017 (r324831) @@ -1411,7 +1411,6 @@ nvpair_create_nvlist_array(const char *name, const nvl int flags; nvls = NULL; - ii = 0; if (value == NULL || nitems == 0) { ERRNO_SET(EINVAL);