mirror of
https://github.com/ipxe/ipxe
synced 2026-01-23 20:49:40 +03:00
[uaccess] Add explicit casts to and from userptr_t where needed
Allow for the possibility of userptr_t becoming a pointer type by adding explicit casts where necessary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -43,7 +43,7 @@ UACCESS_INLINE ( linux, user_to_phys ) ( userptr_t userptr, off_t offset ) {
|
||||
* virtual address will suffice for the purpose of determining
|
||||
* alignment.
|
||||
*/
|
||||
return ( userptr + offset );
|
||||
return ( ( unsigned long ) ( userptr + offset ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ static inline __always_inline userptr_t
|
||||
UACCESS_INLINE ( linux, phys_to_user ) ( physaddr_t phys_addr ) {
|
||||
|
||||
/* For symmetry with the stub user_to_phys() */
|
||||
return phys_addr;
|
||||
return ( ( userptr_t ) phys_addr );
|
||||
}
|
||||
|
||||
static inline __always_inline userptr_t
|
||||
|
||||
@@ -224,12 +224,12 @@ trivial_memchr_user ( userptr_t buffer, off_t offset, int c, size_t len ) {
|
||||
|
||||
static inline __always_inline userptr_t
|
||||
UACCESS_INLINE ( flat, phys_to_user ) ( unsigned long phys_addr ) {
|
||||
return phys_addr;
|
||||
return ( ( userptr_t ) phys_addr );
|
||||
}
|
||||
|
||||
static inline __always_inline unsigned long
|
||||
UACCESS_INLINE ( flat, user_to_phys ) ( userptr_t userptr, off_t offset ) {
|
||||
return ( userptr + offset );
|
||||
return ( ( unsigned long ) ( userptr + offset ) );
|
||||
}
|
||||
|
||||
static inline __always_inline userptr_t
|
||||
|
||||
Reference in New Issue
Block a user