Commit ccdd6170 authored by Will Deacon's avatar Will Deacon Committed by Will Deacon
Browse files

BACKPORT: FROMGIT: Mark anonymous struct field of 'struct vm_fault' as 'const'

The fields of this struct are only ever read after being initialised, so
mark it 'const' before somebody tries to modify it again. GCC will then
complain (with an error) about modification of these fields after they
have been initialised, although LLVM currently allows them without even
a warning:

Hopefully, future versions of LLVM will emit a warning.

Cc: Kirill A. Shutemov <>
Cc: Linus Torvalds <>
Signed-off-by: default avatarWill Deacon <>
Change-Id: I46e2de1252751b863442383eac22090c4b4606c0
Bug: 171278850
(cherry picked from commit 5857c920

[vinmenon: changes for speculative page fault]
Signed-off-by: default avatarVinayak Menon <>
parent cab48b24
......@@ -521,7 +521,7 @@ struct vm_fault {
unsigned int sequence;
pmd_t orig_pmd; /* value of PMD at the time of fault */
struct {
const struct {
struct vm_area_struct *vma; /* Target VMA */
gfp_t gfp_mask; /* gfp mask to be used for allocations */
pgoff_t pgoff; /* Logical page offset based on vma */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment