diff options
author | Dan Carpenter <error27@gmail.com> | 2011-03-19 00:53:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-19 00:53:03 -0400 |
commit | 93d03203d5a165d7a757546245dd1543dfe0ff80 (patch) | |
tree | ac2019f7d1509dff913bf063a613f0e24630a97a /drivers/net | |
parent | b51bdad63046d1d5a4807630cc8c02845cf67893 (diff) |
ftmac100: use resource_size()
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ftmac100.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index 1d6f4b8d393a..a31661948c42 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c | |||
@@ -1102,7 +1102,7 @@ static int ftmac100_probe(struct platform_device *pdev) | |||
1102 | goto err_req_mem; | 1102 | goto err_req_mem; |
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | priv->base = ioremap(res->start, res->end - res->start); | 1105 | priv->base = ioremap(res->start, resource_size(res)); |
1106 | if (!priv->base) { | 1106 | if (!priv->base) { |
1107 | dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n"); | 1107 | dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n"); |
1108 | err = -EIO; | 1108 | err = -EIO; |