mirror of
https://github.com/ipxe/ipxe
synced 2025-12-16 17:41:18 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user