消除大部分警告

This commit is contained in:
KAAAsS 2021-05-18 21:54:18 +08:00
parent 83e83abf39
commit 2aa02613db
Signed by: KAAAsS
GPG Key ID: D56625F3E671882F
5 changed files with 3 additions and 10 deletions

View File

@ -68,7 +68,6 @@ int handle_trans_fault(struct vmspace *vmspace, vaddr_t fault_addr)
struct vmregion *vmr;
struct pmobject *pmo;
paddr_t pa;
u64 offset;
int ret;
/*

View File

@ -180,9 +180,7 @@ static struct page *merge_page(struct phys_mem_pool *pool, struct page *page) {
list_del(&buddy->node);
pool->free_lists[page->order].nr_free -= 2;
// 选择左侧 page
struct page *t;
if (buddy < page) {
t = page;
page = buddy;
}
// 增加 page 的 order

View File

@ -318,10 +318,7 @@ u64 sys_handle_brk(u64 addr)
{
struct vmspace *vmspace;
struct pmobject *pmo;
struct vmregion *vmr;
size_t len;
u64 retval;
int ret;
vmspace = obj_get(current_process, VMSPACE_OBJ_ID, TYPE_VMSPACE);

View File

@ -34,10 +34,10 @@ int stack_backtrace()
// Your code here.
u64 *fp, *preFp;
fp = read_fp();
fp = (u64 *) read_fp();
// until stack end
while (true) {
preFp = *fp;
preFp = (u64 *) *fp;
// entry frame
if (preFp == 0)
break;

View File

@ -395,7 +395,7 @@ int sys_create_thread(u64 process_cap, u64 stack, u64 pc, u64 arg, u32 prio,
int sys_set_affinity(u64 thread_cap, s32 aff)
{
struct thread *thread = NULL;
int cpuid = smp_get_cpu_id(), ret = 0;
int cpuid = smp_get_cpu_id();
/* currently, we use -1 to represent the current thread */
if (thread_cap == -1) {
@ -424,7 +424,6 @@ int sys_get_affinity(u64 thread_cap)
{
struct thread *thread = NULL;
int cpuid = smp_get_cpu_id();
s32 aff = 0;
/* currently, we use -1 to represent the current thread */
if (thread_cap == -1) {