aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-01-01 11:40:49 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-02-22 19:16:56 -0500
commitb26b2d494b659f988b4d75eb394dfa0ddac415c9 (patch)
treed262f333e529a21017dc072e604a626b38520515 /kernel
parent93da6202264ce1256b04db8008a43882ae62d060 (diff)
resource/PCI: align functions now return start of resource
As suggested by Linus, align functions should return the start of a resource, not void. An update of "res->start" is no longer necessary. Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/resource.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index af96c1e4b54b..e697f20e2288 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -303,8 +303,10 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
303static int find_resource(struct resource *root, struct resource *new, 303static int find_resource(struct resource *root, struct resource *new,
304 resource_size_t size, resource_size_t min, 304 resource_size_t size, resource_size_t min,
305 resource_size_t max, resource_size_t align, 305 resource_size_t max, resource_size_t align,
306 void (*alignf)(void *, struct resource *, 306 resource_size_t (*alignf)(void *,
307 resource_size_t, resource_size_t), 307 struct resource *,
308 resource_size_t,
309 resource_size_t),
308 void *alignf_data) 310 void *alignf_data)
309{ 311{
310 struct resource *this = root->child; 312 struct resource *this = root->child;
@@ -330,7 +332,7 @@ static int find_resource(struct resource *root, struct resource *new,
330 tmp.end = max; 332 tmp.end = max;
331 tmp.start = ALIGN(tmp.start, align); 333 tmp.start = ALIGN(tmp.start, align);
332 if (alignf) 334 if (alignf)
333 alignf(alignf_data, &tmp, size, align); 335 tmp.start = alignf(alignf_data, &tmp, size, align);
334 if (tmp.start < tmp.end && tmp.end - tmp.start >= size - 1) { 336 if (tmp.start < tmp.end && tmp.end - tmp.start >= size - 1) {
335 new->start = tmp.start; 337 new->start = tmp.start;
336 new->end = tmp.start + size - 1; 338 new->end = tmp.start + size - 1;
@@ -358,8 +360,10 @@ static int find_resource(struct resource *root, struct resource *new,
358int allocate_resource(struct resource *root, struct resource *new, 360int allocate_resource(struct resource *root, struct resource *new,
359 resource_size_t size, resource_size_t min, 361 resource_size_t size, resource_size_t min,
360 resource_size_t max, resource_size_t align, 362 resource_size_t max, resource_size_t align,
361 void (*alignf)(void *, struct resource *, 363 resource_size_t (*alignf)(void *,
362 resource_size_t, resource_size_t), 364 struct resource *,
365 resource_size_t,
366 resource_size_t),
363 void *alignf_data) 367 void *alignf_data)
364{ 368{
365 int err; 369 int err;