aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/ibmphp_res.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_res.c')
-rw-r--r--drivers/pci/hotplug/ibmphp_res.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c
index 2f2fcc8f7f8b..219ba8090a37 100644
--- a/drivers/pci/hotplug/ibmphp_res.c
+++ b/drivers/pci/hotplug/ibmphp_res.c
@@ -1044,7 +1044,9 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
1044 /* found our range */ 1044 /* found our range */
1045 if (!res_prev) { 1045 if (!res_prev) {
1046 /* first time in the loop */ 1046 /* first time in the loop */
1047 if ((res_cur->start != range->start) && ((len_tmp = res_cur->start - 1 - range->start) >= res->len)) { 1047 len_tmp = res_cur->start - 1 - range->start;
1048
1049 if ((res_cur->start != range->start) && (len_tmp >= res->len)) {
1048 debug ("len_tmp = %x\n", len_tmp); 1050 debug ("len_tmp = %x\n", len_tmp);
1049 1051
1050 if ((len_tmp < len_cur) || (len_cur == 0)) { 1052 if ((len_tmp < len_cur) || (len_cur == 0)) {
@@ -1084,7 +1086,9 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
1084 } 1086 }
1085 if (!res_cur->next) { 1087 if (!res_cur->next) {
1086 /* last device on the range */ 1088 /* last device on the range */
1087 if ((range->end != res_cur->end) && ((len_tmp = range->end - (res_cur->end + 1)) >= res->len)) { 1089 len_tmp = range->end - (res_cur->end + 1);
1090
1091 if ((range->end != res_cur->end) && (len_tmp >= res->len)) {
1088 debug ("len_tmp = %x\n", len_tmp); 1092 debug ("len_tmp = %x\n", len_tmp);
1089 if ((len_tmp < len_cur) || (len_cur == 0)) { 1093 if ((len_tmp < len_cur) || (len_cur == 0)) {
1090 1094
@@ -1123,8 +1127,9 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
1123 if (res_prev) { 1127 if (res_prev) {
1124 if (res_prev->rangeno != res_cur->rangeno) { 1128 if (res_prev->rangeno != res_cur->rangeno) {
1125 /* 1st device on this range */ 1129 /* 1st device on this range */
1126 if ((res_cur->start != range->start) && 1130 len_tmp = res_cur->start - 1 - range->start;
1127 ((len_tmp = res_cur->start - 1 - range->start) >= res->len)) { 1131
1132 if ((res_cur->start != range->start) && (len_tmp >= res->len)) {
1128 if ((len_tmp < len_cur) || (len_cur == 0)) { 1133 if ((len_tmp < len_cur) || (len_cur == 0)) {
1129 if ((range->start % tmp_divide) == 0) { 1134 if ((range->start % tmp_divide) == 0) {
1130 /* just perfect, starting address is divisible by length */ 1135 /* just perfect, starting address is divisible by length */