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>
This commit is contained in:
Francois Berder
2023-09-29 16:45:40 +03:00
committed by Eugen Hristev
parent d6b4359e50
commit 7b4ffe8c32
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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)