Thread (23 messages) 23 messages, 4 authors, 2021-02-10
STALE1939d
Revisions (2)
  1. v3 current
  2. v4 [diff vs current]

[RFC PATCH 8/8] mm: Mark 'info' field of 'struct vm_fault' as 'const'

From: Will Deacon <will@kernel.org>
Date: 2021-01-14 18:02:15
Also in: linux-arm-kernel, lkml
Subsystem: memory management - core, the rest · Maintainers: Andrew Morton, David Hildenbrand, Linus Torvalds

The field is only ever read after being initialised, so mark it 'const'
before somebody tries to modify it again.

Cc: Kirill A. Shutemov <redacted>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Will Deacon <will@kernel.org>
---
 include/linux/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c24dd17b32c5..b45a8e075f7f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -521,7 +521,7 @@ struct vm_fault_info {
 };
 
 struct vm_fault {
-	struct vm_fault_info info;
+	const struct vm_fault_info info;
 	unsigned int flags;		/* FAULT_FLAG_xxx flags
 					 * XXX: should be in vm_fault_info */
 	pmd_t *pmd;			/* Pointer to pmd entry matching
-- 
2.30.0.284.gd98b1dd5eaa7-goog

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help