summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2025-04-20 18:18:06 +0200
committerMichael Brown2025-04-20 18:20:30 +0200
commit63d27c6311db07780dfd7a0bd939c96b60e20a7c (patch)
treee229491c088e58c3e01475b7029d6dee64565a35 /src/include
parent[time] Use currticks() to provide the null system time (diff)
downloadipxe-63d27c6311db07780dfd7a0bd939c96b60e20a7c.tar.gz
ipxe-63d27c6311db07780dfd7a0bd939c96b60e20a7c.tar.xz
ipxe-63d27c6311db07780dfd7a0bd939c96b60e20a7c.zip
[uaccess] Rename userptr_sub() to userptr_diff()
Clarify the intended usage of userptr_sub() by renaming it to userptr_diff() (to avoid confusion with userptr_add()), and fix the existing call sites that erroneously use userptr_sub() to subtract an offset from a userptr_t value. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/linux/linux_uaccess.h6
-rw-r--r--src/include/ipxe/uaccess.h10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/include/ipxe/linux/linux_uaccess.h b/src/include/ipxe/linux/linux_uaccess.h
index a642b6163..b29aa14bd 100644
--- a/src/include/ipxe/linux/linux_uaccess.h
+++ b/src/include/ipxe/linux/linux_uaccess.h
@@ -75,9 +75,9 @@ UACCESS_INLINE ( linux, userptr_add ) ( userptr_t userptr, off_t offset ) {
}
static inline __always_inline off_t
-UACCESS_INLINE ( linux, userptr_sub ) ( userptr_t userptr,
- userptr_t subtrahend ) {
- return trivial_userptr_sub ( userptr, subtrahend );
+UACCESS_INLINE ( linux, userptr_diff ) ( userptr_t userptr,
+ userptr_t subtrahend ) {
+ return trivial_userptr_diff ( userptr, subtrahend );
}
static inline __always_inline void
diff --git a/src/include/ipxe/uaccess.h b/src/include/ipxe/uaccess.h
index b71361cab..2575faca5 100644
--- a/src/include/ipxe/uaccess.h
+++ b/src/include/ipxe/uaccess.h
@@ -96,7 +96,7 @@ trivial_userptr_add ( userptr_t userptr, off_t offset ) {
* @ret offset Offset
*/
static inline __always_inline off_t
-trivial_userptr_sub ( userptr_t userptr, userptr_t subtrahend ) {
+trivial_userptr_diff ( userptr_t userptr, userptr_t subtrahend ) {
return ( userptr - subtrahend );
}
@@ -248,9 +248,9 @@ UACCESS_INLINE ( flat, userptr_add ) ( userptr_t userptr, off_t offset ) {
}
static inline __always_inline off_t
-UACCESS_INLINE ( flat, userptr_sub ) ( userptr_t userptr,
- userptr_t subtrahend ) {
- return trivial_userptr_sub ( userptr, subtrahend );
+UACCESS_INLINE ( flat, userptr_diff ) ( userptr_t userptr,
+ userptr_t subtrahend ) {
+ return trivial_userptr_diff ( userptr, subtrahend );
}
static inline __always_inline void
@@ -349,7 +349,7 @@ userptr_t userptr_add ( userptr_t userptr, off_t offset );
* @v subtrahend User pointer to be subtracted
* @ret offset Offset
*/
-off_t userptr_sub ( userptr_t userptr, userptr_t subtrahend );
+off_t userptr_diff ( userptr_t userptr, userptr_t subtrahend );
/**
* Convert virtual address to a physical address