-
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: Remove get_fs/set_fs call sites
Use new helpers to access user/kernel for functions, which are used with user/kernel pointers. Instead of dealing with get_fs/set_fs select user/kernel access via parameter. 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
08ee3a0
commit 45deb5f
Showing
3 changed files
with
136 additions
and
186 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
|
||
#include <linux/uaccess.h> | ||
|
||
static inline int __get_addr(unsigned long *a, unsigned long *p, bool user) | ||
{ | ||
return user ? get_user(*a, p) : get_kernel_nofault(*a, p); | ||
} | ||
|
||
static inline int __get_inst16(u16 *i, u16 *p, bool user) | ||
{ | ||
return user ? get_user(*i, p) : get_kernel_nofault(*i, p); | ||
} | ||
|
||
static inline int __get_inst32(u32 *i, u32 *p, bool user) | ||
{ | ||
return user ? get_user(*i, p) : get_kernel_nofault(*i, p); | ||
} |
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
Oops, something went wrong.