From 91d0e0e4597c5ed341ae56ea52dec679230683d4 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 31 Jan 2017 16:16:15 +0100 Subject: ax25: Delete useless casts of malloc's return value. malloc returns a void pointer so no cast is necessary when assigning to a pointer type. Found with below coccinelle script: @malloccast@ type T; @@ - (T *) malloc(...) Signed-off-by: Ralf Baechle --- ax25/beacon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ax25/beacon.c') diff --git a/ax25/beacon.c b/ax25/beacon.c index b212ac8..d4f39c7 100644 --- a/ax25/beacon.c +++ b/ax25/beacon.c @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) } if (srccall != NULL && strcmp(srccall, portcall) != 0) { - if ((addr = (char *) malloc(strlen(srccall) + 1 + strlen(portcall) + 1)) == NULL) + if ((addr = malloc(strlen(srccall) + 1 + strlen(portcall) + 1)) == NULL) return 1; sprintf(addr, "%s %s", srccall, portcall); } else { -- cgit v1.2.3