net: sparx5: fix resource_size.cocci warnings
Use resource_size function on resource object instead of explicit computation. Clean up coccicheck warning: ./drivers/net/ethernet/microchip/sparx5/sparx5_main.c:237:19-22: ERROR: Missing resource_size with iores [ idx ] Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@ -234,8 +234,7 @@ static int sparx5_create_targets(struct sparx5 *sparx5)
|
|||||||
}
|
}
|
||||||
iomem[idx] = devm_ioremap(sparx5->dev,
|
iomem[idx] = devm_ioremap(sparx5->dev,
|
||||||
iores[idx]->start,
|
iores[idx]->start,
|
||||||
iores[idx]->end - iores[idx]->start
|
resource_size(iores[idx]));
|
||||||
+ 1);
|
|
||||||
if (!iomem[idx]) {
|
if (!iomem[idx]) {
|
||||||
dev_err(sparx5->dev, "Unable to get switch registers: %s\n",
|
dev_err(sparx5->dev, "Unable to get switch registers: %s\n",
|
||||||
iores[idx]->name);
|
iores[idx]->name);
|
||||||
|
Reference in New Issue
Block a user