Skip to content

Commit

Permalink
phy: fix resource_size.cocci warnings
Browse files Browse the repository at this point in the history
drivers/phy/microchip/sparx5_serdes.c:2440:54-57: ERROR: Missing resource_size with iores

 Use resource_size function on resource object
 instead of explicit computation.

Generated by: scripts/coccinelle/api/resource_size.cocci

Fixes: 2ff8a1e ("phy: Add Sparx5 ethernet serdes PHY driver")
CC: Steen Hegelund <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/r/20210318232844.GA65886@63b0c5462fda
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
intel-lab-lkp authored and vinodkoul committed Apr 6, 2021
1 parent 8595ffb commit cbc336c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/phy/microchip/sparx5_serdes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,7 @@ static int sparx5_serdes_probe(struct platform_device *pdev)
priv->coreclock = clock;

iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
iomem = devm_ioremap(priv->dev, iores->start, iores->end - iores->start + 1);
iomem = devm_ioremap(priv->dev, iores->start, resource_size(iores));
if (IS_ERR(iomem)) {
dev_err(priv->dev, "Unable to get serdes registers: %s\n",
iores->name);
Expand Down

0 comments on commit cbc336c

Please sign in to comment.