Commit 535bdbe
PCI/IOV: Add pci_resource_num_to_vf_bar() to convert VF BAR number to/from IOV resource
There are multiple places where conversions between IOV resources and
corresponding VF BAR numbers are done.
Extract the logic to pci_resource_num_from_vf_bar() and
pci_resource_num_to_vf_bar() helpers.
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patch.msgid.link/20250702093522.518099-3-michal.winiarski@intel.com1 parent 5a8f77e commit 535bdbe
3 files changed
Lines changed: 36 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
346 | 348 | | |
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
350 | | - | |
| 352 | + | |
351 | 353 | | |
352 | 354 | | |
353 | 355 | | |
| |||
644 | 646 | | |
645 | 647 | | |
646 | 648 | | |
647 | | - | |
648 | | - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
649 | 653 | | |
650 | 654 | | |
651 | 655 | | |
| |||
811 | 815 | | |
812 | 816 | | |
813 | 817 | | |
814 | | - | |
815 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
816 | 822 | | |
817 | 823 | | |
818 | 824 | | |
| |||
871 | 877 | | |
872 | 878 | | |
873 | 879 | | |
874 | | - | |
| 880 | + | |
875 | 881 | | |
876 | 882 | | |
877 | 883 | | |
| |||
933 | 939 | | |
934 | 940 | | |
935 | 941 | | |
936 | | - | |
| 942 | + | |
937 | 943 | | |
938 | 944 | | |
939 | 945 | | |
| |||
999 | 1005 | | |
1000 | 1006 | | |
1001 | 1007 | | |
1002 | | - | |
| 1008 | + | |
1003 | 1009 | | |
1004 | 1010 | | |
1005 | 1011 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
725 | 733 | | |
726 | 734 | | |
727 | 735 | | |
| |||
750 | 758 | | |
751 | 759 | | |
752 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
753 | 771 | | |
754 | 772 | | |
755 | 773 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1888 | 1888 | | |
1889 | 1889 | | |
1890 | 1890 | | |
1891 | | - | |
| 1891 | + | |
| 1892 | + | |
1892 | 1893 | | |
1893 | 1894 | | |
1894 | 1895 | | |
| |||
0 commit comments