[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:
Michael Brown
2025-04-21 00:15:52 +01:00
parent 89fe788689
commit 4535548cba
14 changed files with 15 additions and 60 deletions

View File

@@ -734,8 +734,7 @@ static int fdt_parse_image ( struct fdt *fdt, struct image *image ) {
int rc;
/* Parse image */
if ( ( rc = fdt_parse ( fdt, user_to_virt ( image->data, 0 ),
image->len ) ) != 0 ) {
if ( ( rc = fdt_parse ( fdt, image->data, image->len ) ) != 0 ) {
DBGC ( fdt, "FDT image \"%s\" is invalid: %s\n",
image->name, strerror ( rc ) );
return rc;
@@ -1038,7 +1037,7 @@ static int fdt_urealloc ( struct fdt *fdt, size_t len ) {
assert ( len >= fdt->used );
/* Attempt reallocation */
new = user_to_virt ( urealloc ( virt_to_user ( fdt->raw ), len ), 0 );
new = urealloc ( virt_to_user ( fdt->raw ), len );
if ( ! new ) {
DBGC ( fdt, "FDT could not reallocate from +%#04zx to "
"+%#04zx\n", fdt->len, len );
@@ -1112,7 +1111,7 @@ int fdt_create ( struct fdt_header **hdr, const char *cmdline ) {
}
/* Create modifiable copy */
copy = user_to_virt ( umalloc ( fdt.len ), 0 );
copy = umalloc ( fdt.len );
if ( ! copy ) {
rc = -ENOMEM;
goto err_alloc;