diff options
| author | Michael Brown | 2025-04-21 01:15:52 +0200 |
|---|---|---|
| committer | Michael Brown | 2025-04-21 01:15:52 +0200 |
| commit | 4535548cba255c220719a55d02535e06da82ba47 (patch) | |
| tree | cc889e117fe18ab14ca45033321e5518b550bf7b /src/interface/linux | |
| parent | [uaccess] Remove redundant memcpy_user() and related string functions (diff) | |
| download | ipxe-4535548cba255c220719a55d02535e06da82ba47.tar.gz ipxe-4535548cba255c220719a55d02535e06da82ba47.tar.xz ipxe-4535548cba255c220719a55d02535e06da82ba47.zip | |
[uaccess] Remove redundant user_to_virt()
The user_to_virt() function is now a straightforward wrapper around
addition, with the addend almost invariably being zero.
Remove this redundant wrapper.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/linux')
| -rw-r--r-- | src/interface/linux/linux_acpi.c | 2 | ||||
| -rw-r--r-- | src/interface/linux/linux_smbios.c | 2 | ||||
| -rw-r--r-- | src/interface/linux/linux_sysfs.c | 3 | ||||
| -rw-r--r-- | src/interface/linux/linux_uaccess.c | 1 |
4 files changed, 3 insertions, 5 deletions
diff --git a/src/interface/linux/linux_acpi.c b/src/interface/linux/linux_acpi.c index e658936f2..846db2f1f 100644 --- a/src/interface/linux/linux_acpi.c +++ b/src/interface/linux/linux_acpi.c @@ -101,7 +101,7 @@ static userptr_t linux_acpi_find ( uint32_t signature, unsigned int index ) { filename, strerror ( rc ) ); goto err_read; } - header = user_to_virt ( table->data, 0 ); + header = table->data; if ( ( ( ( size_t ) len ) < sizeof ( *header ) ) || ( ( ( size_t ) len ) < le32_to_cpu ( header->length ) ) ) { rc = -ENOENT; diff --git a/src/interface/linux/linux_smbios.c b/src/interface/linux/linux_smbios.c index 981873943..abe1b19d7 100644 --- a/src/interface/linux/linux_smbios.c +++ b/src/interface/linux/linux_smbios.c @@ -59,7 +59,7 @@ static int linux_find_smbios ( struct smbios *smbios ) { smbios_entry_filename, strerror ( rc ) ); goto err_entry; } - data = user_to_virt ( entry, 0 ); + data = entry; smbios3_entry = data; smbios_entry = data; if ( ( len >= ( ( int ) sizeof ( *smbios3_entry ) ) ) && diff --git a/src/interface/linux/linux_sysfs.c b/src/interface/linux/linux_sysfs.c index 4f0027cd4..cbb23d81d 100644 --- a/src/interface/linux/linux_sysfs.c +++ b/src/interface/linux/linux_sysfs.c @@ -70,8 +70,7 @@ int linux_sysfs_read ( const char *filename, userptr_t *data ) { *data = tmp; /* Read from file */ - read = linux_read ( fd, user_to_virt ( *data, len ), - LINUX_SYSFS_BLKSIZE ); + read = linux_read ( fd, ( *data + len ), LINUX_SYSFS_BLKSIZE ); if ( read == 0 ) break; if ( read < 0 ) { diff --git a/src/interface/linux/linux_uaccess.c b/src/interface/linux/linux_uaccess.c index d777bf3dd..e5c394365 100644 --- a/src/interface/linux/linux_uaccess.c +++ b/src/interface/linux/linux_uaccess.c @@ -29,5 +29,4 @@ FILE_LICENCE(GPL2_OR_LATER); PROVIDE_UACCESS_INLINE(linux, user_to_phys); PROVIDE_UACCESS_INLINE(linux, virt_to_user); -PROVIDE_UACCESS_INLINE(linux, user_to_virt); PROVIDE_UACCESS_INLINE(linux, memchr_user); |
