[uaccess] Remove redundant read_user()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-21 18:55:30 +01:00
parent 050df80bbc
commit 04d0b2fdf9
4 changed files with 11 additions and 25 deletions

View File

@@ -148,7 +148,7 @@ pxenv_file_select ( struct s_PXENV_FILE_SELECT *file_select ) {
*
*/
static PXENV_EXIT_t pxenv_file_read ( struct s_PXENV_FILE_READ *file_read ) {
userptr_t buffer;
void *buffer;
ssize_t len;
DBG ( "PXENV_FILE_READ %d to %04x:%04x+%04x", file_read->FileHandle,
@@ -157,8 +157,8 @@ static PXENV_EXIT_t pxenv_file_read ( struct s_PXENV_FILE_READ *file_read ) {
buffer = real_to_virt ( file_read->Buffer.segment,
file_read->Buffer.offset );
if ( ( len = read_user ( file_read->FileHandle, buffer, 0,
file_read->BufferSize ) ) < 0 ) {
if ( ( len = read ( file_read->FileHandle, buffer,
file_read->BufferSize ) ) < 0 ) {
file_read->Status = PXENV_STATUS ( len );
return PXENV_EXIT_FAILURE;
}

View File

@@ -410,7 +410,8 @@ static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
int len = ix86->regs.cx * COMBOOT_FILE_BLOCKSZ;
int rc;
fd_set fds;
userptr_t buf = real_to_virt ( ix86->segs.es, ix86->regs.bx );
void *buf = real_to_virt ( ix86->segs.es,
ix86->regs.bx );
/* Wait for data ready to read */
FD_ZERO ( &fds );
@@ -418,7 +419,7 @@ static __asmcall __used void int22 ( struct i386_all_regs *ix86 ) {
select ( &fds, 1 );
rc = read_user ( fd, buf, 0, len );
rc = read ( fd, buf, len );
if ( rc < 0 ) {
DBG ( "COMBOOT: read failed\n" );
ix86->regs.si = 0;