Skip to content

Commit aa1edac

Browse files
FlyGoatpaulburton
authored andcommitted
MIPS: ip22: Drop addr_is_ram
It can be replaced by page_is_ram. Signed-off-by: Jiaxun Yang <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
1 parent b3c948e commit aa1edac

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

arch/mips/sgi-ip22/ip28-berr.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <linux/init.h>
1010
#include <linux/kernel.h>
11+
#include <linux/mm.h>
1112
#include <linux/sched.h>
1213
#include <linux/sched/debug.h>
1314
#include <linux/sched/signal.h>
@@ -300,23 +301,6 @@ static void print_buserr(const struct pt_regs *regs)
300301
field, regs->cp0_epc, field, regs->regs[31]);
301302
}
302303

303-
/*
304-
* Check, whether MC's (virtual) DMA address caused the bus error.
305-
* See "Virtual DMA Specification", Draft 1.5, Feb 13 1992, SGI
306-
*/
307-
308-
static int addr_is_ram(unsigned long addr, unsigned sz)
309-
{
310-
int i;
311-
312-
for (i = 0; i < boot_mem_map.nr_map; i++) {
313-
unsigned long a = boot_mem_map.map[i].addr;
314-
if (a <= addr && addr+sz <= a+boot_mem_map.map[i].size)
315-
return 1;
316-
}
317-
return 0;
318-
}
319-
320304
static int check_microtlb(u32 hi, u32 lo, unsigned long vaddr)
321305
{
322306
/* This is likely rather similar to correct code ;-) */
@@ -331,7 +315,7 @@ static int check_microtlb(u32 hi, u32 lo, unsigned long vaddr)
331315
/* PTEIndex is VPN-low (bits [22:14]/[20:12] ?) */
332316
unsigned long pte = (lo >> 6) << 12; /* PTEBase */
333317
pte += 8*((vaddr >> pgsz) & 0x1ff);
334-
if (addr_is_ram(pte, 8)) {
318+
if (page_is_ram(PFN_DOWN(pte))) {
335319
/*
336320
* Note: Since DMA hardware does look up
337321
* translation on its own, this PTE *must*

0 commit comments

Comments
 (0)