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 <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
此提交包含在:
@@ -394,23 +394,21 @@ void __init platform_alloc_bootmem(void)
|
||||
|
||||
/* Loop through looking for resources that want a particular address */
|
||||
for (i = 0; gp_resources[i].flags != 0; i++) {
|
||||
int size = gp_resources[i].end - gp_resources[i].start + 1;
|
||||
int size = resource_size(&gp_resources[i]);
|
||||
if ((gp_resources[i].start != 0) &&
|
||||
((gp_resources[i].flags & IORESOURCE_MEM) != 0)) {
|
||||
reserve_bootmem(dma_to_phys(gp_resources[i].start),
|
||||
size, 0);
|
||||
total += gp_resources[i].end -
|
||||
gp_resources[i].start + 1;
|
||||
total += resource_size(&gp_resources[i]);
|
||||
pr_info("reserve resource %s at %08x (%u bytes)\n",
|
||||
gp_resources[i].name, gp_resources[i].start,
|
||||
gp_resources[i].end -
|
||||
gp_resources[i].start + 1);
|
||||
resource_size(&gp_resources[i]));
|
||||
}
|
||||
}
|
||||
|
||||
/* Loop through assigning addresses for those that are left */
|
||||
for (i = 0; gp_resources[i].flags != 0; i++) {
|
||||
int size = gp_resources[i].end - gp_resources[i].start + 1;
|
||||
int size = resource_size(&gp_resources[i]);
|
||||
if ((gp_resources[i].start == 0) &&
|
||||
((gp_resources[i].flags & IORESOURCE_MEM) != 0)) {
|
||||
void *mem = alloc_bootmem_pages(size);
|
||||
|
新增問題並參考
封鎖使用者