[PATCH 3/4] dm: core: Correct calloc arguments
Peng Fan (OSS)
peng.fan at oss.nxp.com
Fri Jul 3 11:11:26 CEST 2026
From: Peng Fan <peng.fan at nxp.com>
Every other calloc in drivers/core uses calloc(count, size) with count
first. Fix the two reversed calloc(sizeof, 1) calls for consistency.
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
drivers/core/tag.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/core/tag.c b/drivers/core/tag.c
index a3c5cb7e57c..78b5ee6dc07 100644
--- a/drivers/core/tag.c
+++ b/drivers/core/tag.c
@@ -46,7 +46,7 @@ int dev_tag_set_ptr(struct udevice *dev, enum dm_tag_t tag, void *ptr)
return -EEXIST;
}
- node = calloc(sizeof(*node), 1);
+ node = calloc(1, sizeof(*node));
if (!node)
return -ENOMEM;
@@ -70,7 +70,7 @@ int dev_tag_set_val(struct udevice *dev, enum dm_tag_t tag, ulong val)
return -EEXIST;
}
- node = calloc(sizeof(*node), 1);
+ node = calloc(1, sizeof(*node));
if (!node)
return -ENOMEM;
--
2.51.0
More information about the U-Boot
mailing list