hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/arch/x86/kernel/probe_roms.c
....@@ -94,12 +94,12 @@
9494 }
9595
9696 static bool probe_list(struct pci_dev *pdev, unsigned short vendor,
97
- const unsigned char *rom_list)
97
+ const void *rom_list)
9898 {
9999 unsigned short device;
100100
101101 do {
102
- if (probe_kernel_address(rom_list, device) != 0)
102
+ if (get_kernel_nofault(device, rom_list) != 0)
103103 device = 0;
104104
105105 if (device && match_id(pdev, vendor, device))
....@@ -119,19 +119,19 @@
119119 for (i = 0; i < ARRAY_SIZE(adapter_rom_resources); i++) {
120120 struct resource *res = &adapter_rom_resources[i];
121121 unsigned short offset, vendor, device, list, rev;
122
- const unsigned char *rom;
122
+ const void *rom;
123123
124124 if (res->end == 0)
125125 break;
126126
127127 rom = isa_bus_to_virt(res->start);
128
- if (probe_kernel_address(rom + 0x18, offset) != 0)
128
+ if (get_kernel_nofault(offset, rom + 0x18) != 0)
129129 continue;
130130
131
- if (probe_kernel_address(rom + offset + 0x4, vendor) != 0)
131
+ if (get_kernel_nofault(vendor, rom + offset + 0x4) != 0)
132132 continue;
133133
134
- if (probe_kernel_address(rom + offset + 0x6, device) != 0)
134
+ if (get_kernel_nofault(device, rom + offset + 0x6) != 0)
135135 continue;
136136
137137 if (match_id(pdev, vendor, device)) {
....@@ -139,8 +139,8 @@
139139 break;
140140 }
141141
142
- if (probe_kernel_address(rom + offset + 0x8, list) == 0 &&
143
- probe_kernel_address(rom + offset + 0xc, rev) == 0 &&
142
+ if (get_kernel_nofault(list, rom + offset + 0x8) == 0 &&
143
+ get_kernel_nofault(rev, rom + offset + 0xc) == 0 &&
144144 rev >= 3 && list &&
145145 probe_list(pdev, vendor, rom + offset + list)) {
146146 oprom = res;
....@@ -183,14 +183,14 @@
183183 const unsigned short * const ptr = (const unsigned short *)rom;
184184 unsigned short sig;
185185
186
- return probe_kernel_address(ptr, sig) == 0 && sig == ROMSIGNATURE;
186
+ return get_kernel_nofault(sig, ptr) == 0 && sig == ROMSIGNATURE;
187187 }
188188
189189 static int __init romchecksum(const unsigned char *rom, unsigned long length)
190190 {
191191 unsigned char sum, c;
192192
193
- for (sum = 0; length && probe_kernel_address(rom++, c) == 0; length--)
193
+ for (sum = 0; length && get_kernel_nofault(c, rom++) == 0; length--)
194194 sum += c;
195195 return !length && !sum;
196196 }
....@@ -211,7 +211,7 @@
211211
212212 video_rom_resource.start = start;
213213
214
- if (probe_kernel_address(rom + 2, c) != 0)
214
+ if (get_kernel_nofault(c, rom + 2) != 0)
215215 continue;
216216
217217 /* 0 < length <= 0x7f * 512, historically */
....@@ -249,7 +249,7 @@
249249 if (!romsignature(rom))
250250 continue;
251251
252
- if (probe_kernel_address(rom + 2, c) != 0)
252
+ if (get_kernel_nofault(c, rom + 2) != 0)
253253 continue;
254254
255255 /* 0 < length <= 0x7f * 512, historically */