]> git.baikalelectronics.ru Git - kernel.git/commit
include/linux/hugetlb.h: convert to use vm_fault_t
authorSouptick Joarder <jrdr.linux@gmail.com>
Fri, 29 Mar 2019 03:43:51 +0000 (20:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 29 Mar 2019 17:01:37 +0000 (10:01 -0700)
commit40295eca4e568ee2b40cd6f1fa3f7e24992e628e
tree16645ac478f842560d9d3a0017f37aa0c3a89b87
parent88cef0534dda0ed92cac80f115d00f16cdce3786
include/linux/hugetlb.h: convert to use vm_fault_t

kbuild produces the below warning:

  tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
  head:   223ae953687c7ea1b8f5f6bc9d8319a1a64c5ef6
  commit c8977e0d3d62 ("mm: create the new vm_fault_t type")
  reproduce:
        # apt-get install sparse
        git checkout c8977e0d3d6232ac8eb6a081732de586302d9b4d
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

  >> mm/memory.c:3968:21: sparse: incorrect type in assignment (different
  >> base types) @@    expected restricted vm_fault_t [usertype] ret @@
  >> got e] ret @@
     mm/memory.c:3968:21:    expected restricted vm_fault_t [usertype] ret
     mm/memory.c:3968:21:    got int

This patch converts to return vm_fault_t type for hugetlb_fault() when
CONFIG_HUGETLB_PAGE=n.

Regarding the sparse warning, Luc said:

: This is the expected behaviour.  The constant 0 is magic regarding bitwise
: types but ({ ...; 0; }) is not, it is just an ordinary expression of type
: 'int'.
:
: So, IMHO, Souptick's patch is the right thing to do.

Link: http://lkml.kernel.org/r/20190318162604.GA31553@jordon-HP-15-Notebook-PC
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/hugetlb.h