mm/alloc: remove all unnecessary cast for alloc

Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-08-28 15:39:47 +08:00
committed by Xiang Xiao
parent db13d5e24c
commit 664927c86e
333 changed files with 485 additions and 566 deletions
+6 -10
View File
@@ -164,9 +164,9 @@ may be used in the file provided that it is used consistently.
int short_name2; /* This is a very long comment describing subtle aspects of the short_name2 field */
};
struct some_medium_name_s *ptr = (struct some_medium_name_s *)malloc(sizeof(some_medium_name_s);
struct some_medium_name_s *ptr = malloc(sizeof(some_medium_name_s);
struct some_long_struct_name_s *ptr = (struct some_long_struct_name_s *)malloc(sizeof(some_long_struct_name_s);
struct some_long_struct_name_s *ptr = malloc(sizeof(some_long_struct_name_s);
ret = some_function_with_many parameters(long_parameter_name_1, long_parameter_name_2, long_parameter_name_3, long_parameter_name_4, long_parameter_name_5, long_parameter_name_6, long_parameter_name_7, long_parameter_name_8);
@@ -195,15 +195,11 @@ may be used in the file provided that it is used consistently.
* aspects of the short_name2 field. */
};
FAR struct some_medium_name_s *ptr = (FAR struct some_medium_name_s *)
malloc(sizeof(some_medium_name_s);
FAR struct some_medium_name_s *ptr = malloc(sizeof(some_medium_name_s);
FAR struct some_medium_name_s *ptr =
(FAR struct some_medium_name_s *)malloc(sizeof(some_medium_name_s);
FAR struct some_medium_name_s *ptr = malloc(sizeof(some_medium_name_s);
FAR struct some_long_struct_name_s *ptr =
(FAR struct some_long_struct_name_s *)
malloc(sizeof(some_long_struct_name_s);
FAR struct some_long_struct_name_s *ptr = malloc(sizeof(some_long_struct_name_s);
ret = some_function_with_many parameters(long_parameter_name_1,
long_parameter_name_2,
@@ -2279,7 +2275,7 @@ Use of ``goto``
goto errout;
}
...
ptr = (FAR struct some_struct_s *)malloc(sizeof(struct some_struct_s));
ptr = malloc(sizeof(struct some_struct_s));
if (!ptr)
{
ret = -ENOMEM;