mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-06 00:13:38 -04:00
maccess: rename probe_kernel_address to get_kernel_nofault
Better describe what this helper does, and match the naming of copy_from_kernel_nofault. Also switch the argument order around, so that it acts and looks like get_user(). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c0ee37e85e
commit
25f12ae45f
20 changed files with 40 additions and 40 deletions
|
@ -318,14 +318,14 @@ long strncpy_from_user_nofault(char *dst, const void __user *unsafe_addr,
|
|||
long strnlen_user_nofault(const void __user *unsafe_addr, long count);
|
||||
|
||||
/**
|
||||
* probe_kernel_address(): safely attempt to read from a location
|
||||
* @addr: address to read from
|
||||
* @retval: read into this variable
|
||||
* get_kernel_nofault(): safely attempt to read from a location
|
||||
* @val: read into this variable
|
||||
* @ptr: address to read from
|
||||
*
|
||||
* Returns 0 on success, or -EFAULT.
|
||||
*/
|
||||
#define probe_kernel_address(addr, retval) \
|
||||
copy_from_kernel_nofault(&retval, addr, sizeof(retval))
|
||||
#define get_kernel_nofault(val, ptr) \
|
||||
copy_from_kernel_nofault(&(val), (ptr), sizeof(val))
|
||||
|
||||
#ifndef user_access_begin
|
||||
#define user_access_begin(ptr,len) access_ok(ptr, len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue