diff --git a/libffi/testsuite/libffi.closures/nested_struct12.c b/libffi/testsuite/libffi.closures/nested_struct12.c
index 0d307ae91f1e7..8dfa71bc5ccb4 100644
--- a/libffi/testsuite/libffi.closures/nested_struct12.c
+++ b/libffi/testsuite/libffi.closures/nested_struct12.c
@@ -41,7 +41,7 @@ int main (void)
 	ffi_type struct_float_type1, struct_float_type2;
 	ffi_type *retType = &ffi_type_float;
 	float arg1;
-	float *arg2 = (float *)malloc(sizeof(stru_Nested_F));
+	float *arg2 = malloc(sizeof(stru_Nested_F));
 
 	struct_float2[0] = &ffi_type_float;
 	struct_float2[1] = &ffi_type_float;
diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c
index eb3084be07f2a..7f2f6fccd69aa 100644
--- a/libgfortran/runtime/backtrace.c
+++ b/libgfortran/runtime/backtrace.c
@@ -67,7 +67,7 @@ has_gfortran_prefix (const char *s)
 static void
 error_callback (void *data, const char *msg, int errnum)
 {
-  struct mystate *state = (struct mystate *) data;
+  struct mystate *state = data;
   struct iovec iov[5];
 #define ERRHDR "\nCould not print backtrace: "
 
@@ -114,7 +114,7 @@ error_callback (void *data, const char *msg, int errnum)
 static int
 simple_callback (void *data, uintptr_t pc)
 {
-  struct mystate *state = (struct mystate *) data;
+  struct mystate *state = data;
   st_printf ("#%d  0x%lx\n", state->frame, (unsigned long) pc);
   (state->frame)++;
   return 0;
@@ -124,7 +124,7 @@ static int
 full_callback (void *data, uintptr_t pc, const char *filename,
 	       int lineno, const char *function)
 {
-  struct mystate *state = (struct mystate *) data;
+  struct mystate *state = data;
 
   if (has_gfortran_prefix (function))
     return 0;