Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
CCXXXI committed Jan 10, 2021
1 parent 8556c8e commit 834389c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/userprog/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static struct open_file *get_file_by_fd(const int fd)
return f;
}

return NULL;
USER_ASSERT(false);
}

/* Terminates the current user program, returning
Expand Down Expand Up @@ -234,8 +234,6 @@ static int write(int fd, const void *buffer, unsigned size)

struct open_file *f = get_file_by_fd(fd);

USER_ASSERT(f != NULL);

lock_acquire(&file_lock);
int ret = file_write(f->file, buffer, size);
lock_release(&file_lock);
Expand Down Expand Up @@ -406,8 +404,6 @@ static int filesize(int fd)
{
struct open_file *f = get_file_by_fd(fd);

USER_ASSERT(f != NULL);

lock_acquire(&file_lock);
int ret = file_length(f->file);
lock_release(&file_lock);
Expand Down Expand Up @@ -436,8 +432,6 @@ static int read(int fd, void *buffer, unsigned size)

struct open_file *f = get_file_by_fd(fd);

USER_ASSERT(f != NULL);

lock_acquire(&file_lock);
int ret = file_read(f->file, buffer, size);
lock_release(&file_lock);
Expand All @@ -459,8 +453,6 @@ static void seek(int fd, unsigned position)
{
struct open_file *f = get_file_by_fd(fd);

USER_ASSERT(f != NULL);

lock_acquire(&file_lock);
file_seek(f->file, position);
lock_release(&file_lock);
Expand Down

0 comments on commit 834389c

Please sign in to comment.