-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: uaccess: Added __get/__put_kernel_nofault
Added __get/__put_kernel_nofault as preparation for removing get/set_fs. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Reviewed-by: Christoph Hellwig <hch@lst.de>
- Loading branch information
Thomas Bogendoerfer
committed
Apr 6, 2021
1 parent
9a91dd5
commit 08ee3a0
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
#include <linux/uaccess.h> | ||
#include <linux/kernel.h> | ||
|
||
bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size) | ||
{ | ||
/* highest bit set means kernel space */ | ||
return (unsigned long)unsafe_src >> (BITS_PER_LONG - 1); | ||
} |