[uaccess] Remove redundant memcpy_user() and related string functions

The memcpy_user(), memmove_user(), memcmp_user(), memset_user(), and
strlen_user() functions are now just straightforward wrappers around
the corresponding standard library functions.

Remove these redundant wrappers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-20 18:29:48 +01:00
parent ef03849185
commit 89fe788689
35 changed files with 83 additions and 331 deletions

View File

@@ -124,7 +124,7 @@ static int efifb_draw ( unsigned int character, unsigned int index,
/* Clear existing glyph */
offset = ( index * efifb.font.height );
memset_user ( efifb.glyphs, offset, 0, efifb.font.height );
memset ( ( efifb.glyphs + offset ), 0, efifb.font.height );
/* Get glyph */
blt = NULL;
@@ -296,7 +296,7 @@ static int efifb_glyphs ( void ) {
rc = -ENOMEM;
goto err_alloc;
}
memset_user ( efifb.glyphs, 0, 0, len );
memset ( efifb.glyphs, 0, len );
/* Get font data */
for ( character = 0 ; character < EFIFB_ASCII ; character++ ) {

View File

@@ -87,8 +87,8 @@ static userptr_t efi_urealloc ( userptr_t old_ptr, size_t new_size ) {
if ( old_ptr && ( old_ptr != UNOWHERE ) ) {
copy_from_user ( &old_size, old_ptr, -EFI_PAGE_SIZE,
sizeof ( old_size ) );
memcpy_user ( new_ptr, 0, old_ptr, 0,
( (old_size < new_size) ? old_size : new_size ));
memcpy ( new_ptr, old_ptr,
( (old_size < new_size) ? old_size : new_size ) );
old_pages = ( EFI_SIZE_TO_PAGES ( old_size ) + 1 );
phys_addr = user_to_phys ( old_ptr, -EFI_PAGE_SIZE );
if ( ( efirc = bs->FreePages ( phys_addr, old_pages ) ) != 0 ){

View File

@@ -30,8 +30,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, memcpy_user);
PROVIDE_UACCESS_INLINE(linux, memmove_user);
PROVIDE_UACCESS_INLINE(linux, memset_user);
PROVIDE_UACCESS_INLINE(linux, strlen_user);
PROVIDE_UACCESS_INLINE(linux, memchr_user);

View File

@@ -277,7 +277,7 @@ int read_smbios_string ( struct smbios_structure *structure,
* smbios_strings struct is constructed so as to
* always end on a string boundary.
*/
string_len = strlen_user ( smbios.address, offset );
string_len = strlen ( smbios.address + offset );
if ( --index == 0 ) {
/* Copy string, truncating as necessary. */
if ( len > string_len )