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>
This commit is contained in:
parent
93da620226
commit
b26b2d494b
21 changed files with 102 additions and 95 deletions
|
@ -303,8 +303,10 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
|
|||
static int find_resource(struct resource *root, struct resource *new,
|
||||
resource_size_t size, resource_size_t min,
|
||||
resource_size_t max, resource_size_t align,
|
||||
void (*alignf)(void *, struct resource *,
|
||||
resource_size_t, resource_size_t),
|
||||
resource_size_t (*alignf)(void *,
|
||||
struct resource *,
|
||||
resource_size_t,
|
||||
resource_size_t),
|
||||
void *alignf_data)
|
||||
{
|
||||
struct resource *this = root->child;
|
||||
|
@ -330,7 +332,7 @@ static int find_resource(struct resource *root, struct resource *new,
|
|||
tmp.end = max;
|
||||
tmp.start = ALIGN(tmp.start, align);
|
||||
if (alignf)
|
||||
alignf(alignf_data, &tmp, size, align);
|
||||
tmp.start = alignf(alignf_data, &tmp, size, align);
|
||||
if (tmp.start < tmp.end && tmp.end - tmp.start >= size - 1) {
|
||||
new->start = tmp.start;
|
||||
new->end = tmp.start + size - 1;
|
||||
|
@ -358,8 +360,10 @@ static int find_resource(struct resource *root, struct resource *new,
|
|||
int allocate_resource(struct resource *root, struct resource *new,
|
||||
resource_size_t size, resource_size_t min,
|
||||
resource_size_t max, resource_size_t align,
|
||||
void (*alignf)(void *, struct resource *,
|
||||
resource_size_t, resource_size_t),
|
||||
resource_size_t (*alignf)(void *,
|
||||
struct resource *,
|
||||
resource_size_t,
|
||||
resource_size_t),
|
||||
void *alignf_data)
|
||||
{
|
||||
int err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue