forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/arch/arm/mm/flush.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mm/flush.c
34 *
45 * 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.
96 */
107 #include <linux/module.h>
118 #include <linux/mm.h>
....@@ -207,18 +204,17 @@
207204 * coherent with the kernels mapping.
208205 */
209206 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));
212208 } else {
213209 unsigned long i;
214210 if (cache_is_vipt_nonaliasing()) {
215
- for (i = 0; i < (1 << compound_order(page)); i++) {
211
+ for (i = 0; i < compound_nr(page); i++) {
216212 void *addr = kmap_atomic(page + i);
217213 __cpuc_flush_dcache_area(addr, PAGE_SIZE);
218214 kunmap_atomic(addr);
219215 }
220216 } else {
221
- for (i = 0; i < (1 << compound_order(page)); i++) {
217
+ for (i = 0; i < compound_nr(page); i++) {
222218 void *addr = kmap_high_get(page + i);
223219 if (addr) {
224220 __cpuc_flush_dcache_area(addr, PAGE_SIZE);