Date: Sat, 21 Oct 2017 19:34:54 +0000 (UTC) From: Mariusz Zaborski <oshogbo@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: r324831 - in stable/11: lib/libnv sys/contrib/libnv Message-ID: <201710211934.v9LJYsmW019509@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710211934.v9LJYsmW019509>