From 695e3a028e1257e1a1460205eba3fc7a837c5b41 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Thu, 17 May 2012 13:31:07 +0100 Subject: [PATCH] sys: Don't cast returns from malloc() malloc() returns a (void *) on all of our current platforms. So, don't bother casting the return value before assigning it - it is unnecessary noise. Change-Id: I58b7695e3cf4b99f17869a46e1efca5c7daf6ff7 Reviewed-on: http://gerrit.openafs.org/7470 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/sys/afssyscalls.c | 3 +-- src/sys/rmtsysc.c | 2 +- src/sys/rmtsysnet.c | 6 +++--- src/sys/rmtsyss.c | 4 +--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/sys/afssyscalls.c b/src/sys/afssyscalls.c index 9780491e0..712e68c89 100644 --- a/src/sys/afssyscalls.c +++ b/src/sys/afssyscalls.c @@ -407,8 +407,7 @@ check_iops(int index, char *fun, char *file, int line) int avail = *availp; avail += IOPS_DEBUG_MALLOC_STEP; if (avail == IOPS_DEBUG_MALLOC_STEP) - iops_debug[index] = - (iops_debug_t *) malloc(avail * sizeof(iops_debug_t)); + iops_debug[index] = malloc(avail * sizeof(iops_debug_t)); else iops_debug[index] = realloc(*iops, avail * sizeof(iops_debug_t)); if (!iops_debug[index]) { diff --git a/src/sys/rmtsysc.c b/src/sys/rmtsysc.c index d5f029287..29c899627 100644 --- a/src/sys/rmtsysc.c +++ b/src/sys/rmtsysc.c @@ -217,7 +217,7 @@ pioctl(char *path, afs_int32 cmd, struct ViceIoctl *data, afs_int32 follow) if (!ins) ins = 1; #endif - if (!(inbuffer = (char *)malloc(ins))) + if (!(inbuffer = malloc(ins))) return (-1); /* helpless here */ if (data->in_size) memcpy(inbuffer, data->in, data->in_size); diff --git a/src/sys/rmtsysnet.c b/src/sys/rmtsysnet.c index 04d3f681b..296145eeb 100644 --- a/src/sys/rmtsysnet.c +++ b/src/sys/rmtsysnet.c @@ -73,7 +73,7 @@ RParseAcl(char *astr) sscanf(astr, "%d", &nminus); astr = RSkipLine(astr); - ta = (struct Acl *)malloc(sizeof(struct Acl)); + ta = malloc(sizeof(struct Acl)); ta->nplus = nplus; ta->nminus = nminus; @@ -82,7 +82,7 @@ RParseAcl(char *astr) for (i = 0; i < nplus; i++) { sscanf(astr, "%100s %d", tname, &trights); astr = RSkipLine(astr); - tl = (struct AclEntry *)malloc(sizeof(struct AclEntry)); + tl = malloc(sizeof(struct AclEntry)); if (!first) first = tl; strcpy(tl->name, tname); @@ -99,7 +99,7 @@ RParseAcl(char *astr) for (i = 0; i < nminus; i++) { sscanf(astr, "%100s %d", tname, &trights); astr = RSkipLine(astr); - tl = (struct AclEntry *)malloc(sizeof(struct AclEntry)); + tl = malloc(sizeof(struct AclEntry)); if (!first) first = tl; strcpy(tl->name, tname); diff --git a/src/sys/rmtsyss.c b/src/sys/rmtsyss.c index ec135e23c..eeecc8478 100644 --- a/src/sys/rmtsyss.c +++ b/src/sys/rmtsyss.c @@ -119,9 +119,7 @@ SRMTSYS_Pioctl(struct rx_call *call, clientcred *creds, char *path, *errornumber = 0; SETCLIENTCONTEXT(blob, rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))), creds->uid, creds->group0, creds->group1, cmd, NFS_EXPORTER); - data.in = - (char *)malloc(InData->rmtbulk_len + - PIOCTL_HEADER * sizeof(afs_int32)); + data.in = malloc(InData->rmtbulk_len + PIOCTL_HEADER * sizeof(afs_int32)); if (!data.in) return (-1); /* helpless here */ if (!strcmp(path, NIL_PATHP)) -- 2.39.5