@@ -125,18 +125,18 @@ static inline void reset_resource(struct resource *res)
125
125
}
126
126
127
127
/**
128
- * adjust_resources_sorted () - satisfy any additional resource requests
128
+ * reassign_resources_sorted () - satisfy any additional resource requests
129
129
*
130
- * @add_head : head of the list tracking requests requiring additional
130
+ * @realloc_head : head of the list tracking requests requiring additional
131
131
* resources
132
132
* @head : head of the list tracking requests with allocated
133
133
* resources
134
134
*
135
- * Walk through each element of the add_head and try to procure
135
+ * Walk through each element of the realloc_head and try to procure
136
136
* additional resources for the element, provided the element
137
137
* is in the head list.
138
138
*/
139
- static void adjust_resources_sorted (struct resource_list_x * add_head ,
139
+ static void reassign_resources_sorted (struct resource_list_x * realloc_head ,
140
140
struct resource_list * head )
141
141
{
142
142
struct resource * res ;
@@ -145,8 +145,8 @@ static void adjust_resources_sorted(struct resource_list_x *add_head,
145
145
resource_size_t add_size ;
146
146
int idx ;
147
147
148
- prev = add_head ;
149
- for (list = add_head -> next ; list ;) {
148
+ prev = realloc_head ;
149
+ for (list = realloc_head -> next ; list ;) {
150
150
res = list -> res ;
151
151
/* skip resource that has been reset */
152
152
if (!res -> flags )
@@ -218,16 +218,16 @@ static void assign_requested_resources_sorted(struct resource_list *head,
218
218
}
219
219
220
220
static void __assign_resources_sorted (struct resource_list * head ,
221
- struct resource_list_x * add_head ,
221
+ struct resource_list_x * realloc_head ,
222
222
struct resource_list_x * fail_head )
223
223
{
224
224
/* Satisfy the must-have resource requests */
225
225
assign_requested_resources_sorted (head , fail_head );
226
226
227
227
/* Try to satisfy any additional optional resource
228
228
requests */
229
- if (add_head )
230
- adjust_resources_sorted ( add_head , head );
229
+ if (realloc_head )
230
+ reassign_resources_sorted ( realloc_head , head );
231
231
free_list (resource_list , head );
232
232
}
233
233
@@ -243,7 +243,7 @@ static void pdev_assign_resources_sorted(struct pci_dev *dev,
243
243
}
244
244
245
245
static void pbus_assign_resources_sorted (const struct pci_bus * bus ,
246
- struct resource_list_x * add_head ,
246
+ struct resource_list_x * realloc_head ,
247
247
struct resource_list_x * fail_head )
248
248
{
249
249
struct pci_dev * dev ;
@@ -253,7 +253,7 @@ static void pbus_assign_resources_sorted(const struct pci_bus *bus,
253
253
list_for_each_entry (dev , & bus -> devices , bus_list )
254
254
__dev_sort_resources (dev , & head );
255
255
256
- __assign_resources_sorted (& head , add_head , fail_head );
256
+ __assign_resources_sorted (& head , realloc_head , fail_head );
257
257
}
258
258
259
259
void pci_setup_cardbus (struct pci_bus * bus )
@@ -548,13 +548,13 @@ static resource_size_t calculate_memsize(resource_size_t size,
548
548
return size ;
549
549
}
550
550
551
- static resource_size_t get_res_add_size (struct resource_list_x * add_head ,
551
+ static resource_size_t get_res_add_size (struct resource_list_x * realloc_head ,
552
552
struct resource * res )
553
553
{
554
554
struct resource_list_x * list ;
555
555
556
- /* check if it is in add_head list */
557
- for (list = add_head -> next ; list && list -> res != res ;
556
+ /* check if it is in realloc_head list */
557
+ for (list = realloc_head -> next ; list && list -> res != res ;
558
558
list = list -> next );
559
559
if (list )
560
560
return list -> add_size ;
@@ -568,15 +568,15 @@ static resource_size_t get_res_add_size(struct resource_list_x *add_head,
568
568
* @bus : the bus
569
569
* @min_size : the minimum io window that must to be allocated
570
570
* @add_size : additional optional io window
571
- * @add_head : track the additional io window on this list
571
+ * @realloc_head : track the additional io window on this list
572
572
*
573
573
* Sizing the IO windows of the PCI-PCI bridge is trivial,
574
574
* since these windows have 4K granularity and the IO ranges
575
575
* of non-bridge PCI devices are limited to 256 bytes.
576
576
* We must be careful with the ISA aliasing though.
577
577
*/
578
578
static void pbus_size_io (struct pci_bus * bus , resource_size_t min_size ,
579
- resource_size_t add_size , struct resource_list_x * add_head )
579
+ resource_size_t add_size , struct resource_list_x * realloc_head )
580
580
{
581
581
struct pci_dev * dev ;
582
582
struct resource * b_res = find_free_bus_resource (bus , IORESOURCE_IO );
@@ -603,15 +603,15 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
603
603
else
604
604
size1 += r_size ;
605
605
606
- if (add_head )
607
- children_add_size += get_res_add_size (add_head , r );
606
+ if (realloc_head )
607
+ children_add_size += get_res_add_size (realloc_head , r );
608
608
}
609
609
}
610
610
size0 = calculate_iosize (size , min_size , size1 ,
611
611
resource_size (b_res ), 4096 );
612
612
if (children_add_size > add_size )
613
613
add_size = children_add_size ;
614
- size1 = (!add_head || (add_head && !add_size )) ? size0 :
614
+ size1 = (!realloc_head || (realloc_head && !add_size )) ? size0 :
615
615
calculate_iosize (size , min_size + add_size , size1 ,
616
616
resource_size (b_res ), 4096 );
617
617
if (!size0 && !size1 ) {
@@ -626,8 +626,8 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
626
626
b_res -> start = 4096 ;
627
627
b_res -> end = b_res -> start + size0 - 1 ;
628
628
b_res -> flags |= IORESOURCE_STARTALIGN ;
629
- if (size1 > size0 && add_head )
630
- add_to_list (add_head , bus -> self , b_res , size1 - size0 , 4096 );
629
+ if (size1 > size0 && realloc_head )
630
+ add_to_list (realloc_head , bus -> self , b_res , size1 - size0 , 4096 );
631
631
}
632
632
633
633
/**
@@ -636,15 +636,15 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
636
636
* @bus : the bus
637
637
* @min_size : the minimum memory window that must to be allocated
638
638
* @add_size : additional optional memory window
639
- * @add_head : track the additional memory window on this list
639
+ * @realloc_head : track the additional memory window on this list
640
640
*
641
641
* Calculate the size of the bus and minimal alignment which
642
642
* guarantees that all child resources fit in this size.
643
643
*/
644
644
static int pbus_size_mem (struct pci_bus * bus , unsigned long mask ,
645
645
unsigned long type , resource_size_t min_size ,
646
646
resource_size_t add_size ,
647
- struct resource_list_x * add_head )
647
+ struct resource_list_x * realloc_head )
648
648
{
649
649
struct pci_dev * dev ;
650
650
resource_size_t min_align , align , size , size0 , size1 ;
@@ -676,10 +676,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
676
676
r_size = resource_size (r );
677
677
#ifdef CONFIG_PCI_IOV
678
678
/* put SRIOV requested res to the optional list */
679
- if (add_head && i >= PCI_IOV_RESOURCES &&
679
+ if (realloc_head && i >= PCI_IOV_RESOURCES &&
680
680
i <= PCI_IOV_RESOURCE_END ) {
681
681
r -> end = r -> start - 1 ;
682
- add_to_list (add_head , dev , r , r_size , 0 /* dont' care */ );
682
+ add_to_list (realloc_head , dev , r , r_size , 0 /* dont' care */ );
683
683
children_add_size += r_size ;
684
684
continue ;
685
685
}
@@ -705,8 +705,8 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
705
705
max_order = order ;
706
706
mem64_mask &= r -> flags & IORESOURCE_MEM_64 ;
707
707
708
- if (add_head )
709
- children_add_size += get_res_add_size (add_head , r );
708
+ if (realloc_head )
709
+ children_add_size += get_res_add_size (realloc_head , r );
710
710
}
711
711
}
712
712
align = 0 ;
@@ -725,7 +725,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
725
725
size0 = calculate_memsize (size , min_size , 0 , resource_size (b_res ), min_align );
726
726
if (children_add_size > add_size )
727
727
add_size = children_add_size ;
728
- size1 = (!add_head || (add_head && !add_size )) ? size0 :
728
+ size1 = (!realloc_head || (realloc_head && !add_size )) ? size0 :
729
729
calculate_memsize (size , min_size + add_size , 0 ,
730
730
resource_size (b_res ), min_align );
731
731
if (!size0 && !size1 ) {
@@ -739,8 +739,8 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
739
739
b_res -> start = min_align ;
740
740
b_res -> end = size0 + min_align - 1 ;
741
741
b_res -> flags |= IORESOURCE_STARTALIGN | mem64_mask ;
742
- if (size1 > size0 && add_head )
743
- add_to_list (add_head , bus -> self , b_res , size1 - size0 , min_align );
742
+ if (size1 > size0 && realloc_head )
743
+ add_to_list (realloc_head , bus -> self , b_res , size1 - size0 , min_align );
744
744
return 1 ;
745
745
}
746
746
@@ -754,7 +754,7 @@ unsigned long pci_cardbus_resource_alignment(struct resource *res)
754
754
}
755
755
756
756
static void pci_bus_size_cardbus (struct pci_bus * bus ,
757
- struct resource_list_x * add_head )
757
+ struct resource_list_x * realloc_head )
758
758
{
759
759
struct pci_dev * bridge = bus -> self ;
760
760
struct resource * b_res = & bridge -> resource [PCI_BRIDGE_RESOURCES ];
@@ -766,13 +766,13 @@ static void pci_bus_size_cardbus(struct pci_bus *bus,
766
766
*/
767
767
b_res [0 ].start = 0 ;
768
768
b_res [0 ].flags |= IORESOURCE_IO | IORESOURCE_SIZEALIGN ;
769
- if (add_head )
770
- add_to_list (add_head , bridge , b_res , pci_cardbus_io_size , 0 /* dont care */ );
769
+ if (realloc_head )
770
+ add_to_list (realloc_head , bridge , b_res , pci_cardbus_io_size , 0 /* dont care */ );
771
771
772
772
b_res [1 ].start = 0 ;
773
773
b_res [1 ].flags |= IORESOURCE_IO | IORESOURCE_SIZEALIGN ;
774
- if (add_head )
775
- add_to_list (add_head , bridge , b_res + 1 , pci_cardbus_io_size , 0 /* dont care */ );
774
+ if (realloc_head )
775
+ add_to_list (realloc_head , bridge , b_res + 1 , pci_cardbus_io_size , 0 /* dont care */ );
776
776
777
777
/*
778
778
* Check whether prefetchable memory is supported
@@ -793,18 +793,18 @@ static void pci_bus_size_cardbus(struct pci_bus *bus,
793
793
if (ctrl & PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 ) {
794
794
b_res [2 ].start = 0 ;
795
795
b_res [2 ].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH | IORESOURCE_SIZEALIGN ;
796
- if (add_head )
797
- add_to_list (add_head , bridge , b_res + 2 , pci_cardbus_mem_size , 0 /* dont care */ );
796
+ if (realloc_head )
797
+ add_to_list (realloc_head , bridge , b_res + 2 , pci_cardbus_mem_size , 0 /* dont care */ );
798
798
799
799
b_res [3 ].start = 0 ;
800
800
b_res [3 ].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN ;
801
- if (add_head )
802
- add_to_list (add_head , bridge , b_res + 3 , pci_cardbus_mem_size , 0 /* dont care */ );
801
+ if (realloc_head )
802
+ add_to_list (realloc_head , bridge , b_res + 3 , pci_cardbus_mem_size , 0 /* dont care */ );
803
803
} else {
804
804
b_res [3 ].start = 0 ;
805
805
b_res [3 ].flags |= IORESOURCE_MEM | IORESOURCE_SIZEALIGN ;
806
- if (add_head )
807
- add_to_list (add_head , bridge , b_res + 3 , pci_cardbus_mem_size * 2 , 0 /* dont care */ );
806
+ if (realloc_head )
807
+ add_to_list (realloc_head , bridge , b_res + 3 , pci_cardbus_mem_size * 2 , 0 /* dont care */ );
808
808
}
809
809
810
810
/* set the size of the resource to zero, so that the resource does not
@@ -816,7 +816,7 @@ static void pci_bus_size_cardbus(struct pci_bus *bus,
816
816
}
817
817
818
818
void __ref __pci_bus_size_bridges (struct pci_bus * bus ,
819
- struct resource_list_x * add_head )
819
+ struct resource_list_x * realloc_head )
820
820
{
821
821
struct pci_dev * dev ;
822
822
unsigned long mask , prefmask ;
@@ -829,12 +829,12 @@ void __ref __pci_bus_size_bridges(struct pci_bus *bus,
829
829
830
830
switch (dev -> class >> 8 ) {
831
831
case PCI_CLASS_BRIDGE_CARDBUS :
832
- pci_bus_size_cardbus (b , add_head );
832
+ pci_bus_size_cardbus (b , realloc_head );
833
833
break ;
834
834
835
835
case PCI_CLASS_BRIDGE_PCI :
836
836
default :
837
- __pci_bus_size_bridges (b , add_head );
837
+ __pci_bus_size_bridges (b , realloc_head );
838
838
break ;
839
839
}
840
840
}
@@ -858,19 +858,19 @@ void __ref __pci_bus_size_bridges(struct pci_bus *bus,
858
858
* Follow thru
859
859
*/
860
860
default :
861
- pbus_size_io (bus , 0 , additional_io_size , add_head );
861
+ pbus_size_io (bus , 0 , additional_io_size , realloc_head );
862
862
/* If the bridge supports prefetchable range, size it
863
863
separately. If it doesn't, or its prefetchable window
864
864
has already been allocated by arch code, try
865
865
non-prefetchable range for both types of PCI memory
866
866
resources. */
867
867
mask = IORESOURCE_MEM ;
868
868
prefmask = IORESOURCE_MEM | IORESOURCE_PREFETCH ;
869
- if (pbus_size_mem (bus , prefmask , prefmask , 0 , additional_mem_size , add_head ))
869
+ if (pbus_size_mem (bus , prefmask , prefmask , 0 , additional_mem_size , realloc_head ))
870
870
mask = prefmask ; /* Success, size non-prefetch only. */
871
871
else
872
872
additional_mem_size += additional_mem_size ;
873
- pbus_size_mem (bus , mask , IORESOURCE_MEM , 0 , additional_mem_size , add_head );
873
+ pbus_size_mem (bus , mask , IORESOURCE_MEM , 0 , additional_mem_size , realloc_head );
874
874
break ;
875
875
}
876
876
}
@@ -882,20 +882,20 @@ void __ref pci_bus_size_bridges(struct pci_bus *bus)
882
882
EXPORT_SYMBOL (pci_bus_size_bridges );
883
883
884
884
static void __ref __pci_bus_assign_resources (const struct pci_bus * bus ,
885
- struct resource_list_x * add_head ,
885
+ struct resource_list_x * realloc_head ,
886
886
struct resource_list_x * fail_head )
887
887
{
888
888
struct pci_bus * b ;
889
889
struct pci_dev * dev ;
890
890
891
- pbus_assign_resources_sorted (bus , add_head , fail_head );
891
+ pbus_assign_resources_sorted (bus , realloc_head , fail_head );
892
892
893
893
list_for_each_entry (dev , & bus -> devices , bus_list ) {
894
894
b = dev -> subordinate ;
895
895
if (!b )
896
896
continue ;
897
897
898
- __pci_bus_assign_resources (b , add_head , fail_head );
898
+ __pci_bus_assign_resources (b , realloc_head , fail_head );
899
899
900
900
switch (dev -> class >> 8 ) {
901
901
case PCI_CLASS_BRIDGE_PCI :
@@ -1105,7 +1105,7 @@ void __init
1105
1105
pci_assign_unassigned_resources (void )
1106
1106
{
1107
1107
struct pci_bus * bus ;
1108
- struct resource_list_x add_list ; /* list of resources that
1108
+ struct resource_list_x realloc_list ; /* list of resources that
1109
1109
want additional resources */
1110
1110
int tried_times = 0 ;
1111
1111
enum release_type rel_type = leaf_only ;
@@ -1118,7 +1118,7 @@ pci_assign_unassigned_resources(void)
1118
1118
1119
1119
1120
1120
head .next = NULL ;
1121
- add_list .next = NULL ;
1121
+ realloc_list .next = NULL ;
1122
1122
1123
1123
pci_try_num = max_depth + 1 ;
1124
1124
printk (KERN_DEBUG "PCI: max bus depth: %d pci_try_num: %d\n" ,
@@ -1128,12 +1128,12 @@ pci_assign_unassigned_resources(void)
1128
1128
/* Depth first, calculate sizes and alignments of all
1129
1129
subordinate buses. */
1130
1130
list_for_each_entry (bus , & pci_root_buses , node )
1131
- __pci_bus_size_bridges (bus , & add_list );
1131
+ __pci_bus_size_bridges (bus , & realloc_list );
1132
1132
1133
1133
/* Depth last, allocate resources and update the hardware. */
1134
1134
list_for_each_entry (bus , & pci_root_buses , node )
1135
- __pci_bus_assign_resources (bus , & add_list , & head );
1136
- BUG_ON (add_list .next );
1135
+ __pci_bus_assign_resources (bus , & realloc_list , & head );
1136
+ BUG_ON (realloc_list .next );
1137
1137
tried_times ++ ;
1138
1138
1139
1139
/* any device complain? */
0 commit comments