diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2017-12-01 21:07:18 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-12-19 06:07:47 +0100 |
commit | f37e2334bca5c5653ad15cadc7d68c78324b956b (patch) | |
tree | 1d2e1a501b6ebc2412ff34e26b97af9ab28812f8 /kernel/resource.c | |
parent | resource: Set type of "reserve=" user-specified resources (diff) | |
download | linux-f37e2334bca5c5653ad15cadc7d68c78324b956b.tar.xz linux-f37e2334bca5c5653ad15cadc7d68c78324b956b.zip |
resource: Set type when reserving new regions
Set resource structs inserted by __reserve_region_with_split() to have the
correct type. Setting the type doesn't fix any functional problem but
makes %pR on the resource work better.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'kernel/resource.c')
-rw-r--r-- | kernel/resource.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index ba3252f7c319..8c527d83ca76 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -1022,6 +1022,7 @@ static void __init __reserve_region_with_split(struct resource *root, struct resource *conflict; struct resource *res = alloc_resource(GFP_ATOMIC); struct resource *next_res = NULL; + int type = resource_type(root); if (!res) return; @@ -1029,7 +1030,7 @@ static void __init __reserve_region_with_split(struct resource *root, res->name = name; res->start = start; res->end = end; - res->flags = IORESOURCE_BUSY; + res->flags = type | IORESOURCE_BUSY; res->desc = IORES_DESC_NONE; while (1) { @@ -1064,7 +1065,7 @@ static void __init __reserve_region_with_split(struct resource *root, next_res->name = name; next_res->start = conflict->end + 1; next_res->end = end; - next_res->flags = IORESOURCE_BUSY; + next_res->flags = type | IORESOURCE_BUSY; next_res->desc = IORES_DESC_NONE; } } else { |