Commit 0b92e594 authored by Markus Elfring's avatar Markus Elfring Committed by David S. Miller

net: mvpp2: Improve two size determinations in mvpp2_probe()

Replace the specification of two data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 02c91ece
...@@ -6873,7 +6873,7 @@ static int mvpp2_probe(struct platform_device *pdev) ...@@ -6873,7 +6873,7 @@ static int mvpp2_probe(struct platform_device *pdev)
int port_count, cpu; int port_count, cpu;
int err; int err;
priv = devm_kzalloc(&pdev->dev, sizeof(struct mvpp2), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
...@@ -6970,8 +6970,8 @@ static int mvpp2_probe(struct platform_device *pdev) ...@@ -6970,8 +6970,8 @@ static int mvpp2_probe(struct platform_device *pdev)
} }
priv->port_list = devm_kcalloc(&pdev->dev, port_count, priv->port_list = devm_kcalloc(&pdev->dev, port_count,
sizeof(struct mvpp2_port *), sizeof(*priv->port_list),
GFP_KERNEL); GFP_KERNEL);
if (!priv->port_list) { if (!priv->port_list) {
err = -ENOMEM; err = -ENOMEM;
goto err_mg_clk; goto err_mg_clk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment