Skip to content

Commit

Permalink
ftmac100: use resource_size()
Browse files Browse the repository at this point in the history
The calculation is off-by-one.  It should be "end - start + 1".  This
patch fixes it to use resource_size() instead.  Oddly, the code already
uses resource size correctly a couple lines earlier when it calls
request_mem_region() for this memory.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Mar 19, 2011
1 parent b51bdad commit 93d0320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ftmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ static int ftmac100_probe(struct platform_device *pdev)
goto err_req_mem;
}

priv->base = ioremap(res->start, res->end - res->start);
priv->base = ioremap(res->start, resource_size(res));
if (!priv->base) {
dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n");
err = -EIO;
Expand Down

0 comments on commit 93d0320

Please sign in to comment.