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
+1 -1
View File
@@ -391,7 +391,7 @@ struct cipher *cipher_init(uint8_t * key, uint8_t * iv)
{
struct cipher *c;
c = (struct cipher *)malloc(sizeof(*c));
c = malloc(sizeof(*c));
if (!c)
{
return NULL;
+3 -3
View File
@@ -156,7 +156,7 @@ static struct elf_file *load_elf(const char *filename)
return NULL;
}
ef = (struct elf_file *)malloc(sizeof(*ef));
ef = malloc(sizeof(*ef));
if (!ef)
{
return NULL;
@@ -166,7 +166,7 @@ static struct elf_file *load_elf(const char *filename)
fsize = (size_t) ftell(fp);
fseek(fp, pos, SEEK_SET);
buf = (char *)malloc(fsize);
buf = malloc(fsize);
if (!buf)
{
return NULL;
@@ -254,7 +254,7 @@ static void *create_image(struct elf_file *elf, int core, char *savename,
imgsize = sizeof(*header) + snlen + (nphs * 16) + psize;
img = (char *)malloc(imgsize + 32);
img = malloc(imgsize + 32);
if (!img)
{
return NULL;