aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-12-01 15:07:18 -0500
committerBjorn Helgaas <bhelgaas@google.com>2017-12-19 00:07:47 -0500
commitf37e2334bca5c5653ad15cadc7d68c78324b956b (patch)
tree1d2e1a501b6ebc2412ff34e26b97af9ab28812f8
parentffd2e8df8d138e7436e218e0a9d3447a18b888e6 (diff)
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>
-rw-r--r--kernel/resource.c5
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,
1022 struct resource *conflict; 1022 struct resource *conflict;
1023 struct resource *res = alloc_resource(GFP_ATOMIC); 1023 struct resource *res = alloc_resource(GFP_ATOMIC);
1024 struct resource *next_res = NULL; 1024 struct resource *next_res = NULL;
1025 int type = resource_type(root);
1025 1026
1026 if (!res) 1027 if (!res)
1027 return; 1028 return;
@@ -1029,7 +1030,7 @@ static void __init __reserve_region_with_split(struct resource *root,
1029 res->name = name; 1030 res->name = name;
1030 res->start = start; 1031 res->start = start;
1031 res->end = end; 1032 res->end = end;
1032 res->flags = IORESOURCE_BUSY; 1033 res->flags = type | IORESOURCE_BUSY;
1033 res->desc = IORES_DESC_NONE; 1034 res->desc = IORES_DESC_NONE;
1034 1035
1035 while (1) { 1036 while (1) {
@@ -1064,7 +1065,7 @@ static void __init __reserve_region_with_split(struct resource *root,
1064 next_res->name = name; 1065 next_res->name = name;
1065 next_res->start = conflict->end + 1; 1066 next_res->start = conflict->end + 1;
1066 next_res->end = end; 1067 next_res->end = end;
1067 next_res->flags = IORESOURCE_BUSY; 1068 next_res->flags = type | IORESOURCE_BUSY;
1068 next_res->desc = IORES_DESC_NONE; 1069 next_res->desc = IORES_DESC_NONE;
1069 } 1070 }
1070 } else { 1071 } else {