Unix CM: Don't cast allocator returns
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 17 May 2012 08:19:03 +0000 (09:19 +0100)
committerDerrick Brashear <shadow@dementix.org>
Thu, 24 May 2012 15:53:03 +0000 (08:53 -0700)
All of our allocators return (void *) values, so there is no need
to cast the returns - doing so is just noise.

Change-Id: I6b1009efbb5034225a4af0e19d03b74c628dfb82
Reviewed-on: http://gerrit.openafs.org/7457
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

31 files changed:
src/afs/AIX/osi_file.c
src/afs/DARWIN/osi_file.c
src/afs/DARWIN/osi_sleep.c
src/afs/FBSD/osi_file.c
src/afs/FBSD/osi_vcache.c
src/afs/HPUX/osi_file.c
src/afs/IRIX/osi_file.c
src/afs/IRIX/osi_sleep.c
src/afs/LINUX24/osi_file.c
src/afs/LINUX24/osi_groups.c
src/afs/NBSD/osi_file.c
src/afs/NBSD/osi_sleep.c
src/afs/NBSD/osi_vcache.c
src/afs/OBSD/osi_file.c
src/afs/OBSD/osi_sleep.c
src/afs/OBSD/osi_vcache.c
src/afs/SOLARIS/osi_file.c
src/afs/SOLARIS/osi_groups.c
src/afs/SOLARIS/osi_sleep.c
src/afs/UKERNEL/afs_usrops.c
src/afs/UKERNEL/osi_groups.c
src/afs/VNOPS/afs_vnop_lookup.c
src/afs/VNOPS/afs_vnop_readdir.c
src/afs/VNOPS/afs_vnop_symlink.c
src/afs/afs_bypasscache.c
src/afs/afs_dcache.c
src/afs/afs_fetchstore.c
src/afs/afs_icl.c
src/afs/afs_mariner.c
src/afs/afs_pioctl.c
src/afs/afs_segments.c

index 6784140..9e70da4 100644 (file)
@@ -42,7 +42,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     setuerror(0);
     AFS_GUNLOCK();
     ip = (struct inode *)igetinode((dev_t) cacheDev.dev, afs_cacheVfsp,
index 14be585..b619910 100644 (file)
@@ -155,7 +155,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
 #endif
        afs_osicred_initialized = 1;
     }
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
 #ifdef AFS_CACHE_VNODE_PATH
     if (!ainode->ufs) {
index 2a4fb27..789091d 100644 (file)
@@ -124,7 +124,7 @@ afs_getevent(char *event)
        evp = evp->next;
     }
     if (!newp) {
-       newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+       newp = osi_AllocSmallSpace(sizeof(afs_event_t));
        afs_evhashcnt++;
        newp->next = afs_evhasht[hashcode];
        afs_evhasht[hashcode] = newp;
index 32debc3..2b809dd 100644 (file)
@@ -36,7 +36,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     AFS_STATCNT(osi_UFSOpen);
     if (cacheDiskType != AFS_FCACHE_TYPE_UFS)
        osi_Panic("UFSOpen called for non-UFS cache\n");
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
     code = VFS_VGET(afs_cacheVfsp, (ino_t) ainode->ufs, LK_EXCLUSIVE, &vp);
     AFS_GLOCK();
index d400492..07c3327 100644 (file)
@@ -44,7 +44,7 @@ struct vcache *
 osi_NewVnode(void) {
     struct vcache *tvc;
 
-    tvc = (struct vcache *)afs_osi_Alloc(sizeof(struct vcache));
+    tvc = afs_osi_Alloc(sizeof(struct vcache));
     tvc->v = NULL; /* important to clean this, or use memset 0 */
 
     return tvc;
index 587c149..44ed271 100644 (file)
@@ -42,7 +42,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     setuerror(0);
     AFS_GUNLOCK();
     ip = (struct inode *)igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev,
index 02ea9b6..bdb458f 100644 (file)
@@ -55,7 +55,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
     afile->vnode = afs_XFSIGetVnode(ainode->ufs);
     AFS_GLOCK();
index 0f8c674..e47b07f 100644 (file)
@@ -100,7 +100,7 @@ afs_getevent(char *event)
        evp = evp->next;
     }
     if (!newp) {
-       newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+       newp = osi_AllocSmallSpace(sizeof(afs_event_t));
        afs_evhashcnt++;
        newp->next = afs_evhasht[hashcode];
        afs_evhasht[hashcode] = newp;
index fc90208..b184602 100644 (file)
@@ -44,7 +44,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
        crhold(&afs_osi_cred);  /* don't let it evaporate, since it is static */
        afs_osicred_initialized = 1;
     }
-    afile = (struct osi_file *)osi_AllocLargeSpace(sizeof(struct osi_file));
+    afile = osi_AllocLargeSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
     if (!afile) {
        osi_Panic("osi_UFSOpen: Failed to allocate %d bytes for osi_file.\n",
index a0ac21d..fa63780 100644 (file)
@@ -121,7 +121,7 @@ __setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag,
     afs_int32 ngroups, code = 0;
     int j;
 
-    gidset = (gid_t *) osi_Alloc(NGROUPS * sizeof(gidset[0]));
+    gidset = osi_Alloc(NGROUPS * sizeof(gidset[0]));
     ngroups = afs_getgroups(*cr, gidset);
 
     if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) {
index 6716ca0..dd7811a 100644 (file)
@@ -31,7 +31,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     AFS_STATCNT(osi_UFSOpen);
     if (cacheDiskType != AFS_FCACHE_TYPE_UFS)
        osi_Panic("UFSOpen called for non-UFS cache\n");
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
     code = VFS_VGET(cacheDev.mp, (ino_t) ainode->ufs, &vp);
     AFS_GLOCK();
index 76dab43..dfa0719 100644 (file)
@@ -218,7 +218,7 @@ afs_getevent(char *event)
        evp = evp->next;
     }
     if (!newp) {
-       newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+       newp = osi_AllocSmallSpace(sizeof(afs_event_t));
        afs_evhashcnt++;
        newp->next = afs_evhasht[hashcode];
        afs_evhasht[hashcode] = newp;
index 82034a3..8b37efa 100644 (file)
@@ -42,7 +42,7 @@ osi_NewVnode(void)
 {
     struct vcache *tvc;
 
-    tvc = (struct vcache *)afs_osi_Alloc(sizeof(struct vcache));
+    tvc = afs_osi_Alloc(sizeof(struct vcache));
     tvc->v = NULL; /* important to clean this, or use memset 0 */
 
     return tvc;
index 4b79cb3..c19d86b 100644 (file)
@@ -34,7 +34,7 @@ osi_UFSOpen(afs_dcache_id_t *ainode)
     AFS_STATCNT(osi_UFSOpen);
     if (cacheDiskType != AFS_FCACHE_TYPE_UFS)
        osi_Panic("UFSOpen called for non-UFS cache\n");
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
     code = VFS_VGET(cacheDev.mp, ainode->ufs, &vp);
     AFS_GLOCK();
index ccc74a4..cbfdddc 100644 (file)
@@ -150,7 +150,7 @@ afs_getevent(char *event)
         evp = evp->next;
     }
     if (!newp) {
-        newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+        newp = osi_AllocSmallSpace(sizeof(afs_event_t));
         afs_evhashcnt++;
         newp->next = afs_evhasht[hashcode];
         afs_evhasht[hashcode] = newp;
index 6598cea..f6e4fca 100644 (file)
@@ -37,7 +37,7 @@ struct vcache *
 osi_NewVnode(void) {
     struct vcache *tvc;
 
-    tvc = (struct vcache *)afs_osi_Alloc(sizeof(struct vcache));
+    tvc = afs_osi_Alloc(sizeof(struct vcache));
     tvc->v = NULL; /* important to clean this, or use memset 0 */
 
     return tvc;
index 6416992..a1284aa 100644 (file)
@@ -143,7 +143,7 @@ osi_VxfsOpen(afs_dcache_id_t *ainode)
     struct osi_file *afile = NULL;
     afs_int32 code = 0;
     int dummy;
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
     code = (*vxfs_vx_vp_byino) (afs_cacheVfsp, &vp, (unsigned int)ainode->ufs);
     AFS_GLOCK();
@@ -175,7 +175,7 @@ osi_UfsOpen(afs_dcache_id_t *ainode)
     struct pathname lookpn;
 #endif
     struct osi_stat tstat;
-    afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+    afile = osi_AllocSmallSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
 
 /*
index 0e4078a..f8ac702 100644 (file)
@@ -80,7 +80,7 @@ setpag(cred, pagvalue, newpag, change_parent)
 
     AFS_STATCNT(setpag);
 
-    gidset = (gid_t *) osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+    gidset = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
 
     mutex_enter(&curproc->p_crlock);
     ngroups = afs_getgroups(*cred, gidset);
index 2197d9e..79a9e46 100644 (file)
@@ -96,7 +96,7 @@ afs_getevent(char *event)
        evp = evp->next;
     }
     if (!newp) {
-       newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+       newp = osi_AllocSmallSpace(sizeof(afs_event_t));
        afs_evhashcnt++;
        newp->next = afs_evhasht[hashcode];
        afs_evhasht[hashcode] = newp;
index 7972d84..2b37ce5 100644 (file)
@@ -329,7 +329,7 @@ usr_crcopy(struct usr_ucred *credp)
 {
     struct usr_ucred *newcredp;
 
-    newcredp = (struct usr_ucred *)afs_osi_Alloc(sizeof(struct usr_ucred));
+    newcredp = afs_osi_Alloc(sizeof(struct usr_ucred));
     *newcredp = *credp;
     newcredp->cr_ref = 1;
     return newcredp;
@@ -340,7 +340,7 @@ usr_crget(void)
 {
     struct usr_ucred *newcredp;
 
-    newcredp = (struct usr_ucred *)afs_osi_Alloc(sizeof(struct usr_ucred));
+    newcredp = afs_osi_Alloc(sizeof(struct usr_ucred));
     newcredp->cr_ref = 1;
     return newcredp;
 }
@@ -391,9 +391,7 @@ uafs_InitThread(void)
      * allocate the data block, so pthread_finish can free the buffer
      * when this thread terminates.
      */
-    uptr =
-       (struct usr_user *)malloc(sizeof(struct usr_user) +
-                                 sizeof(struct usr_ucred));
+    uptr = malloc(sizeof(struct usr_user) + sizeof(struct usr_ucred));
     usr_assert(uptr != NULL);
     uptr->u_error = 0;
     uptr->u_prio = 0;
@@ -447,7 +445,7 @@ afs_osi_Sleep(void *x)
     }
     index = WAITHASH(x);
     if (osi_waithash_avail == NULL) {
-       waitp = (osi_wait_t *) afs_osi_Alloc(sizeof(osi_wait_t));
+       waitp = afs_osi_Alloc(sizeof(osi_wait_t));
        usr_cond_init(&waitp->cond);
     } else {
        waitp = osi_waithash_avail;
@@ -533,7 +531,7 @@ afs_osi_Wait(afs_int32 msec, struct afs_osi_WaitHandle *handle, int intok)
        }
        index = WAITHASH((caddr_t) handle);
        if (osi_waithash_avail == NULL) {
-           waitp = (osi_wait_t *) afs_osi_Alloc(sizeof(osi_wait_t));
+           waitp = afs_osi_Alloc(sizeof(osi_wait_t));
            usr_cond_init(&waitp->cond);
        } else {
            waitp = osi_waithash_avail;
@@ -660,7 +658,7 @@ osi_UFSOpen(afs_dcache_id_t *ino)
     AFS_ASSERT_GLOCK();
 
     AFS_GUNLOCK();
-    fp = (struct osi_file *)afs_osi_Alloc(sizeof(struct osi_file));
+    fp = afs_osi_Alloc(sizeof(struct osi_file));
     usr_assert(fp != NULL);
 
     usr_assert(ino->ufs);
@@ -3393,9 +3391,8 @@ uafs_opendir_r(char *path)
     /*
      * Set up the directory structures
      */
-    dirp =
-       (usr_DIR *) afs_osi_Alloc(sizeof(usr_DIR) + USR_DIRSIZE +
-                                 sizeof(struct usr_dirent));
+    dirp = afs_osi_Alloc(sizeof(usr_DIR) + USR_DIRSIZE +
+                        sizeof(struct usr_dirent));
     usr_assert(dirp != NULL);
     dirp->dd_buf = (char *)(dirp + 1);
     dirp->dd_fd = fd;
index f72fd61..c053e15 100644 (file)
@@ -74,7 +74,7 @@ usr_setpag(struct usr_ucred **cred, afs_uint32 pagvalue, afs_uint32 * newpag,
 
     AFS_STATCNT(setpag);
 
-    gidset = (gid_t *) osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+    gidset = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
     ngroups = afs_getgroups(*cred, gidset);
 
     if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) {
index 60064c4..2a5d594 100644 (file)
@@ -205,7 +205,7 @@ EvalMountData(char type, char *data, afs_uint32 states, afs_uint32 cellnum,
      * Don't know why we do this. Would have still found it in above call - jpm.
      */
     if (!tvp && (prefetch == 2) && len < AFS_SMALLOCSIZ - 10) {
-       buf = (char *)osi_AllocSmallSpace(len + 10);
+       buf = osi_AllocSmallSpace(len + 10);
 
        strcpy(buf, volnamep);
        afs_strcat(buf, ".readonly");
@@ -300,8 +300,7 @@ EvalMountPoint(struct vcache *avc, struct vcache *advc,
        auniq = 1;
 
     if (avc->mvid == 0)
-       avc->mvid =
-           (struct VenusFid *)osi_AllocSmallSpace(sizeof(struct VenusFid));
+       avc->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid));
     avc->mvid->Cell = (*avolpp)->cell;
     avc->mvid->Fid.Volume = (*avolpp)->volume;
     avc->mvid->Fid.Vnode = avnoid;
@@ -554,7 +553,7 @@ Check_AtSys(struct vcache *avc, const char *aname,
 
     if (AFS_EQ_ATSYS(aname)) {
        state->offset = 0;
-       state->name = (char *)osi_AllocLargeSpace(MAXSYSNAME);
+       state->name = osi_AllocLargeSpace(MAXSYSNAME);
        state->allocked = 1;
        state->index =
            afs_getsysname(areq, avc, state->name, &num, sysnamelist);
@@ -586,7 +585,7 @@ Next_AtSys(struct vcache *avc, struct vrequest *areq,
 
        if ((tname > state->name + 4) && (AFS_EQ_ATSYS(tname - 4))) {
            state->offset = (tname - 4) - state->name;
-           tname = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+           tname = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
            strncpy(tname, state->name, state->offset);
            state->name = tname;
            state->allocked = 1;
@@ -740,11 +739,9 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
      * one for fids and callbacks, and one for stat info.  Well set
      * up our pointers to the memory from there, too.
      */
-    statsp = (AFSFetchStatus *) 
-           osi_Alloc(AFSCBMAX * sizeof(AFSFetchStatus));
-    fidsp = (AFSFid *) osi_AllocLargeSpace(nentries * sizeof(AFSFid));
-    cbsp = (AFSCallBack *) 
-           osi_Alloc(AFSCBMAX * sizeof(AFSCallBack));
+    statsp = osi_Alloc(AFSCBMAX * sizeof(AFSFetchStatus));
+    fidsp = osi_AllocLargeSpace(nentries * sizeof(AFSFid));
+    cbsp = osi_Alloc(AFSCBMAX * sizeof(AFSCallBack));
 
     /* next, we must iterate over the directory, starting from the specified
      * cookie offset (dirCookie), and counting out nentries file entries.
@@ -1173,8 +1170,7 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
        /* now copy ".." entry back out of volume structure, if necessary */
        if (tvcp->mvstat == 2 && (dotdot.Fid.Volume != 0)) {
            if (!tvcp->mvid)
-               tvcp->mvid = (struct VenusFid *)
-                   osi_AllocSmallSpace(sizeof(struct VenusFid));
+               tvcp->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid));
            *tvcp->mvid = dotdot;
        }
 
@@ -1865,7 +1861,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
                    if (tvolp) {
                        ObtainWriteLock(&tvc->lock, 134);
                        if (tvc->mvid == NULL) {
-                           tvc->mvid = (struct VenusFid *)
+                           tvc->mvid =
                                osi_AllocSmallSpace(sizeof(struct VenusFid));
                        }
                        /* setup backpointer */
index 8316bb9..4b5ea6c 100644 (file)
@@ -455,11 +455,7 @@ afs_readdir_move(struct DirEntry *de, struct vcache *vc, struct uio *auio,
     }
 #else /* AFS_SGI53_ENV */
 #if  defined(AFS_SUN5_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
-#if    defined(AFS_SUN5_ENV)
-    direntp = (struct dirent64 *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
-#else
-    direntp = (struct dirent *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
-#endif
+    direntp = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
     direntp->d_ino = afs_calc_inum(vc->f.fid.Cell, Volume, ntohl(Vnode));
 #if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
     direntp->d_offset = off;
@@ -605,8 +601,7 @@ afs_readdir(OSI_VC_DECL(avc), struct uio *auio, afs_ucred_t *acred)
      * it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs
      * translator side XXX
      */
-    struct min_direct *sdirEntry =
-       (struct min_direct *)osi_AllocSmallSpace(sizeof(struct min_direct));
+    struct min_direct *sdirEntry = osi_AllocSmallSpace(sizeof(struct min_direct));
     afs_int32 rlen;
 #endif
 
index 3754c9c..13591ce 100644 (file)
@@ -324,7 +324,7 @@ afs_MemHandleLink(struct vcache *avc, struct vrequest *areq)
            alen = len + 1;     /* regular link */
        else
            alen = len;         /* mt point */
-       rbuf = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+       rbuf = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
        ObtainReadLock(&tdc->lock);
        addr = afs_MemCacheOpen(&tdc->f.inode);
        tlen = len;
@@ -381,7 +381,7 @@ afs_UFSHandleLink(struct vcache *avc, struct vrequest *areq)
            alen = len + 1;     /* regular link */
        else
            alen = len;         /* mt point */
-       rbuf = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+       rbuf = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
        tlen = len;
        ObtainReadLock(&tdc->lock);
        tfile = osi_UFSOpen(&tdc->f.inode);
index d28ef3b..dd6ff1c 100644 (file)
@@ -582,7 +582,7 @@ afs_PrefetchNoCache(struct vcache *avc,
     iovecp = auio->uio_iov;
 #endif
 
-    tcallspec = (struct tlocal1 *) osi_Alloc(sizeof(struct tlocal1));
+    tcallspec = osi_Alloc(sizeof(struct tlocal1));
     do {
        tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK /* ignored */, &rxconn);
        if (tc) {
index e3bae9b..a2684fc 100644 (file)
@@ -2160,8 +2160,7 @@ afs_GetDCache(struct vcache *avc, afs_size_t abyte,
                           ICL_TYPE_POINTER, tdc, ICL_TYPE_INT32,
                           tdc->dflags);
        }
-       tsmall =
-           (struct afs_FetchOutput *)osi_AllocLargeSpace(sizeof(struct afs_FetchOutput));
+       tsmall = osi_AllocLargeSpace(sizeof(struct afs_FetchOutput));
        setVcacheStatus = 0;
 #ifndef AFS_NOSTATS
        /*
index 9fb766f..bf019c4 100644 (file)
@@ -372,7 +372,7 @@ rxfs_storeInit(struct vcache *avc, struct afs_conn *tc,
     if ( !tc )
        return -1;
 
-    v = (struct rxfs_storeVariables *) osi_AllocSmallSpace(sizeof(struct rxfs_storeVariables));
+    v = osi_AllocSmallSpace(sizeof(struct rxfs_storeVariables));
     if (!v)
         osi_Panic("rxfs_storeInit: osi_AllocSmallSpace returned NULL\n");
     memset(v, 0, sizeof(struct rxfs_storeVariables));
index 5fdd7e5..113703a 100644 (file)
@@ -178,7 +178,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval)
        if (!logp)
            return ENOENT;
 #define        BUFFERSIZE      AFS_LRALLOCSIZ
-       lp = (afs_int32 *) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+       lp = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
        elts = BUFFERSIZE / sizeof(afs_int32);
        if (p3 < elts)
            elts = p3;
@@ -745,8 +745,7 @@ afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize, afs_uint32 flags,
        }
     }
 
-    logp = (struct afs_icl_log *)
-       osi_AllocSmallSpace(sizeof(struct afs_icl_log));
+    logp = osi_AllocSmallSpace(sizeof(struct afs_icl_log));
     memset((caddr_t) logp, 0, sizeof(*logp));
 
     logp->refCount = 1;
@@ -1153,7 +1152,7 @@ afs_icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp,
     if (flags & ICL_CRSET_FLAG_PERSISTENT)
        states |= ICL_SETF_PERSISTENT;
 
-    setp = (struct afs_icl_set *)osi_AllocSmallSpace(sizeof(struct afs_icl_set));
+    setp = osi_AllocSmallSpace(sizeof(struct afs_icl_set));
     memset((caddr_t) setp, 0, sizeof(*setp));
     setp->refCount = 1;
     if (states & ICL_SETF_FREED)
index 9283b9a..30ec11e 100644 (file)
@@ -88,7 +88,7 @@ afs_MarinerLog(char *astring, struct vcache *avc)
 #ifdef  STRUCT_SOCKADDR_HAS_SA_LEN
     taddr.sin_len = sizeof(taddr);
 #endif
-    tp = buf = (char *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+    tp = buf = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
 
     strcpy(tp, astring);
     tp += strlen(astring);
index 5cbbdb0..e1e66b6 100644 (file)
@@ -568,8 +568,7 @@ kioctl(int fdes, int com, caddr_t arg, caddr_t ext)
            if (((uap->com >> 8) & 0xff) == 'V') {
                struct afs_ioctl *datap;
                AFS_GLOCK();
-               datap =
-                   (struct afs_ioctl *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+               datap = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
                code=copyin_afs_ioctl((char *)uap->arg, datap);
                if (code) {
                    osi_FreeSmallSpace(datap);
@@ -677,8 +676,7 @@ afs_xioctl(struct afs_ioctl_sys *uap, rval_t *rvp)
            if (((uap->com >> 8) & 0xff) == 'V') {
                struct afs_ioctl *datap;
                AFS_GLOCK();
-               datap =
-                   (struct afs_ioctl *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+               datap = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
                code=copyin_afs_ioctl((char *)uap->arg, datap);
                if (code) {
                    osi_FreeSmallSpace(datap);
index 192a3d4..48cc204 100644 (file)
@@ -178,7 +178,7 @@ afs_StoreAllSegments(struct vcache *avc, struct vrequest *areq,
     hset(newDV, avc->f.m.DataVersion);
     hash = DVHash(&avc->f.fid);
     foreign = (avc->f.states & CForeign);
-    dcList = (struct dcache **)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+    dcList = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
     afs_Trace2(afs_iclSetp, CM_TRACE_STOREALL, ICL_TYPE_POINTER, avc,
               ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->f.m.Length));
 #if !defined(AFS_AIX32_ENV) && !defined(AFS_SGI65_ENV)