Removed useless check

Fix forward NULL in splat kmem_cache test ctors/dtors



git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@171 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
behlendo 2008-11-04 23:18:31 +00:00
parent 3bc9d50eaa
commit 0498e6c585
2 changed files with 8 additions and 17 deletions

View File

@ -72,9 +72,6 @@ copyinstr(const void *from, void *to, size_t len, size_t *done)
if (len == 0)
return -ENAMETOOLONG;
if (len < 0)
return -EFAULT;
/* XXX: Should return ENAMETOOLONG if 'strlen(from) > len' */
memset(to, 0, len);

View File

@ -262,14 +262,11 @@ splat_kmem_cache_test_constructor(void *ptr, void *priv, int flags)
kmem_cache_priv_t *kcp = (kmem_cache_priv_t *)priv;
kmem_cache_data_t *kcd = (kmem_cache_data_t *)ptr;
if (kcd) {
if (kcp) {
kcd->kcd_magic = kcp->kcp_magic;
kcp->kcp_count++;
}
memset(kcd->kcd_buf, 0xaa, kcp->kcp_size - (sizeof *kcd));
if (kcd && kcp) {
kcd->kcd_magic = kcp->kcp_magic;
kcd->kcd_flag = 1;
memset(kcd->kcd_buf, 0xaa, kcp->kcp_size - (sizeof *kcd));
kcp->kcp_count++;
}
return 0;
@ -281,14 +278,11 @@ splat_kmem_cache_test_destructor(void *ptr, void *priv)
kmem_cache_priv_t *kcp = (kmem_cache_priv_t *)priv;
kmem_cache_data_t *kcd = (kmem_cache_data_t *)ptr;
if (kcd) {
if (kcp) {
kcd->kcd_magic = 0;
kcp->kcp_count--;
}
memset(kcd->kcd_buf, 0xbb, kcp->kcp_size - (sizeof *kcd));
if (kcd && kcp) {
kcd->kcd_magic = 0;
kcd->kcd_flag = 0;
memset(kcd->kcd_buf, 0xbb, kcp->kcp_size - (sizeof *kcd));
kcp->kcp_count--;
}
return;