From: Ben Gras Date: Mon, 5 Jul 2010 13:58:57 +0000 (+0000) Subject: vm: fixes for clang warnings X-Git-Tag: v3.1.8~287 X-Git-Url: http://zhaoyanbai.com/repos/doc/mandoc_char.7.html?a=commitdiff_plain;h=b4bea1bfcbff29ec4815d634020cd71ec9b1de52;p=minix.git vm: fixes for clang warnings --- diff --git a/servers/vm/alloc.c b/servers/vm/alloc.c index b4b82745e..a2c249c67 100644 --- a/servers/vm/alloc.c +++ b/servers/vm/alloc.c @@ -640,7 +640,7 @@ PUBLIC int do_adddma(message *msg) printf("vm:do_adddma: dma table full\n"); for (i= 0; iVMGD_PROCP= dmatab[i].dt_proc; @@ -800,7 +800,7 @@ void printmemstats(void) { int nodes, pages, largest; memstats(&nodes, &pages, &largest); - printf("%d blocks, %d pages (%ukB) free, largest %d pages (%ukB)\n", + printf("%d blocks, %d pages (%lukB) free, largest %d pages (%lukB)\n", nodes, pages, (u32_t) pages * (VM_PAGE_SIZE/1024), largest, (u32_t) largest * (VM_PAGE_SIZE/1024)); } @@ -890,7 +890,7 @@ struct memlist *alloc_mem_in_list(phys_bytes bytes, u32_t flags) } while(mem == NO_MEM && freed > 0); if(mem == NO_MEM) { - printf("alloc_mem_in_list: giving up, %dkB missing\n", + printf("alloc_mem_in_list: giving up, %lukB missing\n", rempages * VM_PAGE_SIZE/1024); printmemstats(); free_mem_list(head, 1); diff --git a/servers/vm/arch/i386/pagetable.c b/servers/vm/arch/i386/pagetable.c index 8c3d7c3a8..ca7f37daa 100644 --- a/servers/vm/arch/i386/pagetable.c +++ b/servers/vm/arch/i386/pagetable.c @@ -120,7 +120,7 @@ PUBLIC void pt_sanitycheck(pt_t *pt, char *file, int line) int pte; MYASSERT(vm_addrok(pt->pt_pt[i], 1)); if(!(pt->pt_dir[i] & I386_VM_PRESENT)) { - printf("slot %d: pt->pt_pt[%d] = 0x%lx, but pt_dir entry 0x%lx\n", + printf("slot %d: pt->pt_pt[%d] = %p, but pt_dir entry 0x%lx\n", slot, i, pt->pt_pt[i], pt->pt_dir[i]); } MYASSERT(pt->pt_dir[i] & I386_VM_PRESENT); @@ -534,7 +534,7 @@ PUBLIC int pt_writemap(pt_t *pt, vir_bytes v, phys_bytes physaddr, * and pt_ptalloc leaves the directory * and other data in a consistent state. */ - printf("pt_writemap: pt_ptalloc failed\n", pdecheck); + printf("pt_writemap: pt_ptalloc failed\n"); return r; } } diff --git a/servers/vm/exec.c b/servers/vm/exec.c index 27045d54f..6c6895e2e 100644 --- a/servers/vm/exec.c +++ b/servers/vm/exec.c @@ -61,7 +61,7 @@ PUBLIC int do_exec_newmem(message *msg) ptr= msg->VMEN_ARGSPTR; if(msg->VMEN_ARGSSIZE != sizeof(args)) { - printf("VM: exec_newmem: args size %d != %ld\n", + printf("VM: exec_newmem: args size %d != %u\n", msg->VMEN_ARGSSIZE, sizeof(args)); return EINVAL; } diff --git a/servers/vm/main.c b/servers/vm/main.c index 03540a62a..5898891ed 100644 --- a/servers/vm/main.c +++ b/servers/vm/main.c @@ -353,9 +353,11 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) CALLMAP(VM_GETREF, do_get_refcount); CALLMAP(VM_INFO, do_info); CALLMAP(VM_QUERY_EXIT, do_query_exit); +#if 0 CALLMAP(VM_FORGETBLOCKS, do_forgetblocks); CALLMAP(VM_FORGETBLOCK, do_forgetblock); CALLMAP(VM_YIELDBLOCKGETBLOCK, do_yieldblockgetblock); +#endif /* Sanity checks */ if(find_kernel_top() >= VM_PROCSTART) diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index 71fc025c8..9257f732f 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -384,7 +384,7 @@ PUBLIC int do_munmap(message *m) } if(!(vr = map_lookup(vmp, addr))) { - printf("VM: unmap: virtual address 0x%lx not found in %d\n", + printf("VM: unmap: virtual address %p not found in %d\n", m->VMUM_ADDR, vmp->vm_endpoint); return EFAULT; } diff --git a/servers/vm/region.c b/servers/vm/region.c index bd7d008dd..54d704908 100644 --- a/servers/vm/region.c +++ b/servers/vm/region.c @@ -99,7 +99,7 @@ PUBLIC void map_printregion(struct vmproc *vmp, struct vir_region *vr) physr_iter iter; struct phys_region *ph; printf("map_printmap: map_name: %s\n", map_name(vr)); - printf("\t%s (len 0x%lx, %dkB), %s\n", + printf("\t%s (len 0x%lx, %lukB), %s\n", arch_map2str(vmp, vr->vaddr), vr->length, vr->length/1024, map_name(vr)); printf("\t\tphysblocks:\n"); @@ -209,7 +209,7 @@ PUBLIC void map_sanitycheck(char *file, int line) MYASSERT(!(vr->vaddr % VM_PAGE_SIZE));, if(pr->ph->refcount != pr->ph->seencount) { map_printmap(vmp); - printf("ph in vr 0x%lx: 0x%lx-0x%lx refcount %d " + printf("ph in vr %p: 0x%lx-0x%lx refcount %d " "but seencount %lu\n", vr, pr->offset, pr->offset + pr->ph->length, @@ -290,7 +290,7 @@ void blockstats(void) } if(blocks > 0) - printf("%d blocks, %dkB; ", blocks, mem/1024); + printf("%d blocks, %lukB; ", blocks, mem/1024); printmemstats(); } @@ -1699,7 +1699,7 @@ PUBLIC int map_remap(struct vmproc *dvmp, vir_bytes da, size_t size, assert(!(size % VM_PAGE_SIZE)); startv = region_find_slot(dvmp, dst_addr, VM_DATATOP, size, &prev); if (startv == (vir_bytes) -1) { - printf("map_remap: search 0x%x...\n", dst_addr); + printf("map_remap: search 0x%lx...\n", dst_addr); map_printmap(dvmp); return ENOMEM; } @@ -1895,7 +1895,7 @@ PUBLIC void printregionstats(struct vmproc *vmp) } } - printf("%6dkB %6dkB\n", used/1024, weighted/1024); + printf("%6lukB %6lukB\n", used/1024, weighted/1024); return; } @@ -2264,7 +2264,7 @@ get_clean_phys_region(struct vmproc *vmp, vir_bytes vaddr, vir_bytes length, assert(ph->offset == regionoffset); if(ph->ph->length != length) { - printf("VM: get_clean_phys_region: len mismatch (%d, %d)\n", + printf("VM: get_clean_phys_region: len mismatch (%lu, %lu)\n", ph->ph->length, length); return NULL; } @@ -2301,7 +2301,7 @@ PRIVATE int getblock(struct vmproc *vmp, u64_t id, /* Check the size as a sanity check. */ if(yb->len != len) { - printf("VM: id 0x%lx%08lx mismatched size (%d, %d) for %d\n", + printf("VM: id 0x%lx%08lx mismatched size (%lu, %lu) for %d\n", ex64hi(id), ex64lo(id), yb->len, len, vmp->vm_endpoint); return ESRCH; } diff --git a/servers/vm/sanitycheck.h b/servers/vm/sanitycheck.h index 76670aec9..30125f4e1 100644 --- a/servers/vm/sanitycheck.h +++ b/servers/vm/sanitycheck.h @@ -42,7 +42,7 @@ } #else -#define SANITYCHECK +#define SANITYCHECK (void) #define SLABSANITYCHECK(l) #define SLABSANE(ptr) #endif diff --git a/servers/vm/slaballoc.c b/servers/vm/slaballoc.c index 48bbf7177..a937c9db4 100644 --- a/servers/vm/slaballoc.c +++ b/servers/vm/slaballoc.c @@ -391,7 +391,7 @@ PRIVATE int objstats(void *mem, int bytes, #if SANITYCHECKS #define OBJSTATSCHECK(cond) \ if(!(cond)) { \ - printf("VM: objstats: %s failed for ptr 0x%p, %d bytes\n", \ + printf("VM: objstats: %s failed for ptr %p, %d bytes\n", \ #cond, mem, bytes); \ return EINVAL; \ }