diff options
| author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-04-14 11:00:36 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-04-14 11:00:36 -0400 |
| commit | 277a163c83d7ba93fba1e8980d29a9f8bfcfba6c (patch) | |
| tree | ccfd357d152292958957b6b8a993892e7a8cc95f /kernel/resource.c | |
| parent | a83b93a7480441a47856dc9104bea970e84cda87 (diff) | |
| parent | c9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff) | |
Merge tag 'v3.15-rc1' into patchwork
Linux 3.15-rc1
* tag 'v3.15-rc1': (12180 commits)
Linux 3.15-rc1
mm: Initialize error in shmem_file_aio_read()
cifs: Use min_t() when comparing "size_t" and "unsigned long"
sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue
powerpc: Don't try to set LPCR unless we're in hypervisor mode
futex: update documentation for ordering guarantees
ceph: fix pr_fmt() redefinition
vti: don't allow to add the same tunnel twice
gre: don't allow to add the same tunnel twice
drivers: net: xen-netfront: fix array initialization bug
missing bits of "splice: fix racy pipe->buffers uses"
cifs: fix the race in cifs_writev()
ceph_sync_{,direct_}write: fix an oops on ceph_osdc_new_request() failure
pktgen: be friendly to LLTX devices
r8152: check RTL8152_UNPLUG
net: sun4i-emac: add promiscuous support
net/apne: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
blackfin: cleanup board files
bf609: clock: drop unused clock bit set/clear functions
Blackfin: bf537: rename "CONFIG_ADT75"
...
Diffstat (limited to 'kernel/resource.c')
| -rw-r--r-- | kernel/resource.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 3f285dce9347..8957d686e29b 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
| @@ -432,11 +432,6 @@ static void resource_clip(struct resource *res, resource_size_t min, | |||
| 432 | res->end = max; | 432 | res->end = max; |
| 433 | } | 433 | } |
| 434 | 434 | ||
| 435 | static bool resource_contains(struct resource *res1, struct resource *res2) | ||
| 436 | { | ||
| 437 | return res1->start <= res2->start && res1->end >= res2->end; | ||
| 438 | } | ||
| 439 | |||
| 440 | /* | 435 | /* |
| 441 | * Find empty slot in the resource tree with the given range and | 436 | * Find empty slot in the resource tree with the given range and |
| 442 | * alignment constraints | 437 | * alignment constraints |
| @@ -471,10 +466,11 @@ static int __find_resource(struct resource *root, struct resource *old, | |||
| 471 | arch_remove_reservations(&tmp); | 466 | arch_remove_reservations(&tmp); |
| 472 | 467 | ||
| 473 | /* Check for overflow after ALIGN() */ | 468 | /* Check for overflow after ALIGN() */ |
| 474 | avail = *new; | ||
| 475 | avail.start = ALIGN(tmp.start, constraint->align); | 469 | avail.start = ALIGN(tmp.start, constraint->align); |
| 476 | avail.end = tmp.end; | 470 | avail.end = tmp.end; |
| 471 | avail.flags = new->flags & ~IORESOURCE_UNSET; | ||
| 477 | if (avail.start >= tmp.start) { | 472 | if (avail.start >= tmp.start) { |
| 473 | alloc.flags = avail.flags; | ||
| 478 | alloc.start = constraint->alignf(constraint->alignf_data, &avail, | 474 | alloc.start = constraint->alignf(constraint->alignf_data, &avail, |
| 479 | size, constraint->align); | 475 | size, constraint->align); |
| 480 | alloc.end = alloc.start + size - 1; | 476 | alloc.end = alloc.start + size - 1; |
| @@ -515,7 +511,7 @@ static int find_resource(struct resource *root, struct resource *new, | |||
| 515 | * @newsize: new size of the resource descriptor | 511 | * @newsize: new size of the resource descriptor |
| 516 | * @constraint: the size and alignment constraints to be met. | 512 | * @constraint: the size and alignment constraints to be met. |
| 517 | */ | 513 | */ |
| 518 | int reallocate_resource(struct resource *root, struct resource *old, | 514 | static int reallocate_resource(struct resource *root, struct resource *old, |
| 519 | resource_size_t newsize, | 515 | resource_size_t newsize, |
| 520 | struct resource_constraint *constraint) | 516 | struct resource_constraint *constraint) |
| 521 | { | 517 | { |
| @@ -949,8 +945,8 @@ struct resource * __request_region(struct resource *parent, | |||
| 949 | res->name = name; | 945 | res->name = name; |
| 950 | res->start = start; | 946 | res->start = start; |
| 951 | res->end = start + n - 1; | 947 | res->end = start + n - 1; |
| 952 | res->flags = IORESOURCE_BUSY; | 948 | res->flags = resource_type(parent); |
| 953 | res->flags |= flags; | 949 | res->flags |= IORESOURCE_BUSY | flags; |
| 954 | 950 | ||
| 955 | write_lock(&resource_lock); | 951 | write_lock(&resource_lock); |
| 956 | 952 | ||
