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:
committed by
Eugen Hristev
parent
d6b4359e50
commit
7b4ffe8c32
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user