mm/gup: make get_user_pages_fast_only() return the common return value
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 24 Jan 2023 20:34:32 +0000 (16:34 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 10 Feb 2023 00:51:45 +0000 (16:51 -0800)
commit9198a9196ee67814a101c178ed828f8ea9c2965e
treeacdf88a4b0afa2e7006d414d778e9e421bb8911d
parentedad1bb1fbf7e28b49bf76b2aa66bfcaba00f627
mm/gup: make get_user_pages_fast_only() return the common return value

There are only two callers, both can handle the common return code:

- get_user_page_fast_only() checks == 1

- gfn_to_page_many_atomic() already returns -1, and the only caller
  checks for negative return values

Remove the restriction against returning negative values.

Link: https://lkml.kernel.org/r/11-v2-987e91b59705+36b-gup_tidy_jgg@nvidia.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/gup.c