提交 5bdd5ded 编写于 作者: T Tobias Klauser 提交者: Herbert Xu

crypto: mv_cesa - Use resource_size

Use the resource_size function instead of manually calculating the
resource size. This reduces the chance of introducing off-by-one errors.
Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 edc774ed
......@@ -1023,7 +1023,7 @@ static int mv_probe(struct platform_device *pdev)
spin_lock_init(&cp->lock);
crypto_init_queue(&cp->queue, 50);
cp->reg = ioremap(res->start, res->end - res->start + 1);
cp->reg = ioremap(res->start, resource_size(res));
if (!cp->reg) {
ret = -ENOMEM;
goto err;
......@@ -1034,7 +1034,7 @@ static int mv_probe(struct platform_device *pdev)
ret = -ENXIO;
goto err_unmap_reg;
}
cp->sram_size = res->end - res->start + 1;
cp->sram_size = resource_size(res);
cp->max_req_size = cp->sram_size - SRAM_CFG_SPACE;
cp->sram = ioremap(res->start, cp->sram_size);
if (!cp->sram) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册