mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
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:
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user