summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-10-26 12:13:03 +0200
committerDave Hansen <dave.hansen@linux.intel.com>2022-12-15 10:37:26 -0800
commitd48567c9a0d1e605639f8a8705a61bbb55fb4e84 (patch)
treee21cc2cc51debdb73db0031a21dac0717af1286e /drivers/misc
parent414ebf148cb5c5fa727ec51fdb69c4ab82dccf3b (diff)
downloadlinux-stable-d48567c9a0d1e605639f8a8705a61bbb55fb4e84.tar.gz
linux-stable-d48567c9a0d1e605639f8a8705a61bbb55fb4e84.tar.bz2
linux-stable-d48567c9a0d1e605639f8a8705a61bbb55fb4e84.zip
mm: Introduce set_memory_rox()
Because endlessly repeating: set_memory_ro() set_memory_x() is getting tedious. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/Y1jek64pXOsougmz@hirez.programming.kicks-ass.net
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/sram-exec.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/misc/sram-exec.c b/drivers/misc/sram-exec.c
index a948e95d4375..b71dbbd73738 100644
--- a/drivers/misc/sram-exec.c
+++ b/drivers/misc/sram-exec.c
@@ -10,9 +10,9 @@
#include <linux/genalloc.h>
#include <linux/mm.h>
#include <linux/sram.h>
+#include <linux/set_memory.h>
#include <asm/fncpy.h>
-#include <asm/set_memory.h>
#include "sram.h"
@@ -106,10 +106,7 @@ void *sram_exec_copy(struct gen_pool *pool, void *dst, void *src,
dst_cpy = fncpy(dst, src, size);
- ret = set_memory_ro((unsigned long)base, pages);
- if (ret)
- goto error_out;
- ret = set_memory_x((unsigned long)base, pages);
+ ret = set_memory_rox((unsigned long)base, pages);
if (ret)
goto error_out;