diff options
Diffstat (limited to 'kernel/resource.c')
| -rw-r--r-- | kernel/resource.c | 21 | 
1 files changed, 7 insertions, 14 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 3f285dce934..3c2237ac32d 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -432,11 +432,6 @@ static void resource_clip(struct resource *res, resource_size_t min,  		res->end = max;  } -static bool resource_contains(struct resource *res1, struct resource *res2) -{ -	return res1->start <= res2->start && res1->end >= res2->end; -} -  /*   * Find empty slot in the resource tree with the given range and   * alignment constraints @@ -471,10 +466,11 @@ static int __find_resource(struct resource *root, struct resource *old,  		arch_remove_reservations(&tmp);  		/* Check for overflow after ALIGN() */ -		avail = *new;  		avail.start = ALIGN(tmp.start, constraint->align);  		avail.end = tmp.end; +		avail.flags = new->flags & ~IORESOURCE_UNSET;  		if (avail.start >= tmp.start) { +			alloc.flags = avail.flags;  			alloc.start = constraint->alignf(constraint->alignf_data, &avail,  					size, constraint->align);  			alloc.end = alloc.start + size - 1; @@ -515,7 +511,7 @@ static int find_resource(struct resource *root, struct resource *new,   * @newsize: new size of the resource descriptor   * @constraint: the size and alignment constraints to be met.   */ -int reallocate_resource(struct resource *root, struct resource *old, +static int reallocate_resource(struct resource *root, struct resource *old,  			resource_size_t newsize,  			struct resource_constraint  *constraint)  { @@ -949,8 +945,8 @@ struct resource * __request_region(struct resource *parent,  	res->name = name;  	res->start = start;  	res->end = start + n - 1; -	res->flags = IORESOURCE_BUSY; -	res->flags |= flags; +	res->flags = resource_type(parent); +	res->flags |= IORESOURCE_BUSY | flags;  	write_lock(&resource_lock); @@ -1292,13 +1288,10 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size)  		if (p->flags & IORESOURCE_BUSY)  			continue; -		printk(KERN_WARNING "resource map sanity check conflict: " -		       "0x%llx 0x%llx 0x%llx 0x%llx %s\n", +		printk(KERN_WARNING "resource sanity check: requesting [mem %#010llx-%#010llx], which spans more than %s %pR\n",  		       (unsigned long long)addr,  		       (unsigned long long)(addr + size - 1), -		       (unsigned long long)p->start, -		       (unsigned long long)p->end, -		       p->name); +		       p->name, p);  		err = -1;  		break;  	}  | 
