]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
dm: core: Correct calloc arguments
authorPeng Fan <peng.fan@nxp.com>
Fri, 3 Jul 2026 09:11:26 +0000 (17:11 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 16 Jul 2026 18:03:05 +0000 (12:03 -0600)
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@nxp.com>
Reviewed-by: Raphaƫl Gallais-Pou <raphael.gallais-pou@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/core/tag.c

index a3c5cb7e57cc8c0f32bffab4fb763b55e1d1dc7a..78b5ee6dc07345a73243cce25ca075ccbcd57552 100644 (file)
@@ -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;