]> Zhao Yanbai Git Server - minix.git/commitdiff
vm: fixes for clang warnings
authorBen Gras <ben@minix3.org>
Mon, 5 Jul 2010 13:58:57 +0000 (13:58 +0000)
committerBen Gras <ben@minix3.org>
Mon, 5 Jul 2010 13:58:57 +0000 (13:58 +0000)
servers/vm/alloc.c
servers/vm/arch/i386/pagetable.c
servers/vm/exec.c
servers/vm/main.c
servers/vm/mmap.c
servers/vm/region.c
servers/vm/sanitycheck.h
servers/vm/slaballoc.c

index b4b82745ea9f067eacc110ff0fe1010b529a98d9..a2c249c670da561367a0542a8bb067ef92ba83e9 100644 (file)
@@ -640,7 +640,7 @@ PUBLIC int do_adddma(message *msg)
                printf("vm:do_adddma: dma table full\n");
                for (i= 0; i<NR_DMA; i++)
                {
-                       printf("%d: flags 0x%x proc %d base 0x%x size 0x%x\n",
+                       printf("%d: flags 0x%x proc %d base 0x%lx size 0x%lx\n",
                                i, dmatab[i].dt_flags,
                                dmatab[i].dt_proc,
                                dmatab[i].dt_base,
@@ -745,7 +745,7 @@ PUBLIC int do_getdma(message *msg)
                if (!(dmatab[i].dt_flags & DTF_RELEASE_DMA))
                        continue;
 
-               printf("do_getdma: setting reply to 0x%x@0x%x proc %d\n",
+               printf("do_getdma: setting reply to 0x%lx@0x%lx proc %d\n",
                        dmatab[i].dt_size, dmatab[i].dt_base,
                        dmatab[i].dt_proc);
                msg->VMGD_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);
index 8c3d7c3a8003837475f7734a4acc4ed161caeeb2..ca7f37daa7a696151318f9886ed75d28f13cd5be 100644 (file)
@@ -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;
                        }
                }
index 27045d54f9aa9e0004189aaf5c7f477045f50b14..6c6895e2e220aa4c76d9082636614fdf1a8d5ac0 100644 (file)
@@ -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;
        }
index 03540a62a5b530bcbc8be77361dd9de1474116f9..5898891edea6a969bdcc301a83f3d2e1a99d83ee 100644 (file)
@@ -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)
index 71fc025c83fa98c3126f2ab3f4320c2b997aad1c..9257f732fa0ddab9219334152c43b1e4690f0d11 100644 (file)
@@ -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;
         }
index bd7d008ddd056b21bf9f7017f29f5c9dc27228dd..54d70490858d767602f625b834531b09d7e69772 100644 (file)
@@ -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;
        }
index 76670aec91489120f7eddf4d344b4c02fa5ec49c..30125f4e10fec6f1073b9af6535782f187dc9313 100644 (file)
@@ -42,7 +42,7 @@
 }
 
 #else
-#define SANITYCHECK 
+#define SANITYCHECK  (void)
 #define SLABSANITYCHECK(l)
 #define SLABSANE(ptr)
 #endif
index 48bbf71774abf00a3c4ee46987c1050324e8e56b..a937c9db4d52997321bf260aa6690812d0386cef 100644 (file)
@@ -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; \
        }