| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/arch/arm/mm/flush.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 1995-2002 Russell King |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | #include <linux/module.h> |
|---|
| 11 | 8 | #include <linux/mm.h> |
|---|
| .. | .. |
|---|
| 207 | 204 | * coherent with the kernels mapping. |
|---|
| 208 | 205 | */ |
|---|
| 209 | 206 | if (!PageHighMem(page)) { |
|---|
| 210 | | - size_t page_size = PAGE_SIZE << compound_order(page); |
|---|
| 211 | | - __cpuc_flush_dcache_area(page_address(page), page_size); |
|---|
| 207 | + __cpuc_flush_dcache_area(page_address(page), page_size(page)); |
|---|
| 212 | 208 | } else { |
|---|
| 213 | 209 | unsigned long i; |
|---|
| 214 | 210 | if (cache_is_vipt_nonaliasing()) { |
|---|
| 215 | | - for (i = 0; i < (1 << compound_order(page)); i++) { |
|---|
| 211 | + for (i = 0; i < compound_nr(page); i++) { |
|---|
| 216 | 212 | void *addr = kmap_atomic(page + i); |
|---|
| 217 | 213 | __cpuc_flush_dcache_area(addr, PAGE_SIZE); |
|---|
| 218 | 214 | kunmap_atomic(addr); |
|---|
| 219 | 215 | } |
|---|
| 220 | 216 | } else { |
|---|
| 221 | | - for (i = 0; i < (1 << compound_order(page)); i++) { |
|---|
| 217 | + for (i = 0; i < compound_nr(page); i++) { |
|---|
| 222 | 218 | void *addr = kmap_high_get(page + i); |
|---|
| 223 | 219 | if (addr) { |
|---|
| 224 | 220 | __cpuc_flush_dcache_area(addr, PAGE_SIZE); |
|---|