]> git.ipfire.org Git - thirdparty/linux.git/commit
mm: fix vm_fault_t cast in VM_FAULT_GET_HINDEX()
authorJann Horn <jannh@google.com>
Sat, 6 Apr 2019 01:39:01 +0000 (18:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Apr 2019 02:02:31 +0000 (16:02 -1000)
commitfcae96ff96538f66e7acd5d4e0f2e7516ff8cbd0
treea3113c1cc5889419069be5e8ec2634c63ce0b7ad
parentb11ed18efa8f3dc58b259b812588317b765b1cfc
mm: fix vm_fault_t cast in VM_FAULT_GET_HINDEX()

Symmetrically to VM_FAULT_SET_HINDEX(), we need a force-cast in
VM_FAULT_GET_HINDEX() to tell sparse that this is intentional.

Sparse complains about the current code when building a kernel with
CONFIG_MEMORY_FAILURE:

  arch/x86/mm/fault.c:1058:53: warning: restricted vm_fault_t degrades to integer

Link: http://lkml.kernel.org/r/20190327204117.35215-1-jannh@google.com
Fixes: 3d3539018d2c ("mm: create the new vm_fault_t type")
Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Rik van Riel <riel@surriel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mm_types.h