mirror of
https://github.com/ipxe/ipxe
synced 2026-02-01 07:26:44 +03:00
[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>
This commit is contained in:
@@ -669,7 +669,7 @@ static userptr_t efipci_dma_umalloc ( struct dma_device *dma,
|
||||
static void efipci_dma_ufree ( struct dma_device *dma, struct dma_mapping *map,
|
||||
userptr_t addr, size_t len ) {
|
||||
|
||||
efipci_dma_free ( dma, map, user_to_virt ( addr, 0 ), len );
|
||||
efipci_dma_free ( dma, map, addr, len );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ) ) ) &&
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user