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@ MFC after: 1 month Found by: scan-build and cppcheck Sponsored by: Wheel Systems
This commit is contained in:
parent
53999485e0
commit
08016b3185
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323851
@ -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));
|
||||
|
||||
|
@ -280,8 +280,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
|
||||
@ -709,7 +708,6 @@ static int *
|
||||
nvlist_xdescriptors(const nvlist_t *nvl, int *descs)
|
||||
{
|
||||
nvpair_t *nvp;
|
||||
const char *name;
|
||||
int type;
|
||||
|
||||
NVLIST_ASSERT(nvl);
|
||||
@ -717,7 +715,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);
|
||||
@ -756,7 +754,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);
|
||||
}
|
||||
@ -787,7 +785,6 @@ nvlist_ndescriptors(const nvlist_t *nvl)
|
||||
{
|
||||
#ifndef _KERNEL
|
||||
nvpair_t *nvp;
|
||||
const char *name;
|
||||
size_t ndescs;
|
||||
int type;
|
||||
|
||||
@ -797,7 +794,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++;
|
||||
@ -830,7 +827,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
|
||||
@ -1258,7 +1255,6 @@ nvlist_send(int sock, const nvlist_t *nvl)
|
||||
return (-1);
|
||||
|
||||
ret = -1;
|
||||
data = NULL;
|
||||
fdidx = 0;
|
||||
|
||||
data = nvlist_xpack(nvl, &fdidx, &datasize);
|
||||
|
@ -1412,7 +1412,6 @@ nvpair_create_nvlist_array(const char *name, const nvlist_t * const *value,
|
||||
|
||||
nvp = NULL;
|
||||
nvls = NULL;
|
||||
ii = 0;
|
||||
|
||||
if (value == NULL || nitems == 0) {
|
||||
ERRNO_SET(EINVAL);
|
||||
|
Loading…
Reference in New Issue
Block a user