summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Berder <fberder@outlook.fr>2023-09-24 12:58:54 +0300
committerEugen Hristev <eugen.hristev@collabora.com>2023-09-29 16:45:40 +0300
commit7b4ffe8c32db284e25d3a2636904def8e093da9e (patch)
tree955dd4aa32e1b71edc5889d28d8af3935a468d56
parentd6b4359e50bb1dc567f6596c67b25a3c7a8ff130 (diff)
downloadu-boot-7b4ffe8c32db284e25d3a2636904def8e093da9e.tar.xz
clk: at91: Fix initializing arrays
Arrays are not cleared entirely because ARRAY_SIZE returns the number of elements in an array, not the size in bytes. This commit fixes the calls to memset by providing the array size in bytes instead of the number of elements in the array. Signed-off-by: Francois Berder <fberder@outlook.fr>
-rw-r--r--drivers/clk/at91/sam9x60.c4
-rw-r--r--drivers/clk/at91/sama7g5.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c
index e2f72446d5..d858c860f6 100644
--- a/drivers/clk/at91/sam9x60.c
+++ b/drivers/clk/at91/sam9x60.c
@@ -429,8 +429,8 @@ static int sam9x60_clk_probe(struct udevice *dev)
if (!base)
return -EINVAL;
- memset(muxallocs, 0, ARRAY_SIZE(muxallocs));
- memset(clkmuxallocs, 0, ARRAY_SIZE(clkmuxallocs));
+ memset(muxallocs, 0, sizeof(muxallocs));
+ memset(clkmuxallocs, 0, sizeof(clkmuxallocs));
ret = clk_get_by_index(dev, 0, &clk);
if (ret)
diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c
index 3abd220803..3e62fb1f58 100644
--- a/drivers/clk/at91/sama7g5.c
+++ b/drivers/clk/at91/sama7g5.c
@@ -1115,8 +1115,8 @@ static int sama7g5_clk_probe(struct udevice *dev)
if (IS_ERR(base))
return PTR_ERR(base);
- memset(muxallocs, 0, ARRAY_SIZE(muxallocs));
- memset(clkmuxallocs, 0, ARRAY_SIZE(clkmuxallocs));
+ memset(muxallocs, 0, sizeof(muxallocs));
+ memset(clkmuxallocs, 0, sizeof(clkmuxallocs));
ret = clk_get_by_index(dev, 0, &clk);
if (ret)