mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing. Done via coccinelle scripts like: @@ struct resource *ptr; @@ - ptr->end - ptr->start + 1 + resource_size(ptr) and some grep and typing. Mostly uncompiled, no cross-compilers. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
parent
140a1ef2f9
commit
28f65c11f2
168 changed files with 308 additions and 333 deletions
|
|
@ -140,7 +140,7 @@ static void __devinit cell_edac_init_csrows(struct mem_ctl_info *mci)
|
|||
if (of_node_to_nid(np) != priv->node)
|
||||
continue;
|
||||
csrow->first_page = r.start >> PAGE_SHIFT;
|
||||
csrow->nr_pages = (r.end - r.start + 1) >> PAGE_SHIFT;
|
||||
csrow->nr_pages = resource_size(&r) >> PAGE_SHIFT;
|
||||
csrow->last_page = csrow->first_page + csrow->nr_pages - 1;
|
||||
csrow->mtype = MEM_XDR;
|
||||
csrow->edac_mode = EDAC_SECDED;
|
||||
|
|
|
|||
|
|
@ -538,15 +538,15 @@ static int __devinit mpc85xx_l2_err_probe(struct platform_device *op)
|
|||
/* we only need the error registers */
|
||||
r.start += 0xe00;
|
||||
|
||||
if (!devm_request_mem_region(&op->dev, r.start,
|
||||
r.end - r.start + 1, pdata->name)) {
|
||||
if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
|
||||
pdata->name)) {
|
||||
printk(KERN_ERR "%s: Error while requesting mem region\n",
|
||||
__func__);
|
||||
res = -EBUSY;
|
||||
goto err;
|
||||
}
|
||||
|
||||
pdata->l2_vbase = devm_ioremap(&op->dev, r.start, r.end - r.start + 1);
|
||||
pdata->l2_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r));
|
||||
if (!pdata->l2_vbase) {
|
||||
printk(KERN_ERR "%s: Unable to setup L2 err regs\n", __func__);
|
||||
res = -ENOMEM;
|
||||
|
|
@ -987,15 +987,15 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (!devm_request_mem_region(&op->dev, r.start,
|
||||
r.end - r.start + 1, pdata->name)) {
|
||||
if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
|
||||
pdata->name)) {
|
||||
printk(KERN_ERR "%s: Error while requesting mem region\n",
|
||||
__func__);
|
||||
res = -EBUSY;
|
||||
goto err;
|
||||
}
|
||||
|
||||
pdata->mc_vbase = devm_ioremap(&op->dev, r.start, r.end - r.start + 1);
|
||||
pdata->mc_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r));
|
||||
if (!pdata->mc_vbase) {
|
||||
printk(KERN_ERR "%s: Unable to setup MC err regs\n", __func__);
|
||||
res = -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue