kernel: Remove some bogus casts to the own type.
authorSascha Wildner <saw@online.de>
Thu, 17 May 2012 23:52:22 +0000 (01:52 +0200)
committerSascha Wildner <saw@online.de>
Thu, 17 May 2012 23:52:22 +0000 (01:52 +0200)
12 files changed:
sys/platform/pc32/i386/busdma_machdep.c
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/isa/prof_machdep.c
sys/platform/pc64/isa/prof_machdep.c
sys/platform/pc64/x86_64/busdma_machdep.c
sys/platform/pc64/x86_64/machdep.c
sys/platform/vkernel/platform/busdma_machdep.c
sys/platform/vkernel/platform/copyio.c
sys/platform/vkernel64/platform/busdma_machdep.c
sys/platform/vkernel64/platform/copyio.c
sys/platform/vkernel64/platform/pmap.c

index 0367e7c..b6e7a8a 100644 (file)
@@ -676,7 +676,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
                        paddr = _bus_dma_extract(pmap, vaddr);
                        if (run_filter(dmat, paddr) != 0)
                                map->pagesneeded++;
-                       vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK));
+                       vaddr += (PAGE_SIZE - (vaddr & PAGE_MASK));
                }
        }
 
index 94725cf..8fc44d2 100644 (file)
@@ -23,7 +23,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.115.2.15 2003/03/14 21:22:35 jhb Exp $
- * $DragonFly: src/sys/platform/pc32/i386/mp_machdep.c,v 1.60 2008/06/07 12:03:52 mneumann Exp $
  */
 
 #include "opt_cpu.h"
@@ -555,14 +554,14 @@ install_ap_tramp(u_int boot_addr)
        /* modify the target for boot code segment */
        dst16 = (u_int16_t *) (dst + ((u_int) bootCodeSeg - boot_base));
        dst8 = (u_int8_t *) (dst16 + 1);
-       *dst16 = (u_int) boot_addr & 0xffff;
-       *dst8 = ((u_int) boot_addr >> 16) & 0xff;
+       *dst16 = boot_addr & 0xffff;
+       *dst8 = (boot_addr >> 16) & 0xff;
 
        /* modify the target for boot data segment */
        dst16 = (u_int16_t *) (dst + ((u_int) bootDataSeg - boot_base));
        dst8 = (u_int8_t *) (dst16 + 1);
-       *dst16 = (u_int) boot_addr & 0xffff;
-       *dst8 = ((u_int) boot_addr >> 16) & 0xff;
+       *dst16 = boot_addr & 0xffff;
+       *dst8 = (boot_addr >> 16) & 0xff;
 }
 
 
index 5b7f11f..5a8af47 100644 (file)
@@ -312,7 +312,7 @@ pmap_pte_quick(pmap_t pmap, vm_offset_t va)
                        *(unsigned *)gd->gd_PMAP1 = newpf | PG_RW | PG_V;
                        cpu_invlpg(gd->gd_PADDR1);
                }
-               return gd->gd_PADDR1 + ((unsigned) index & (NPTEPG - 1));
+               return gd->gd_PADDR1 + (index & (NPTEPG - 1));
        }
        return (0);
 }
index 0762abc..de8d8f7 100644 (file)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/i386/isa/prof_machdep.c,v 1.14.2.1 2000/08/03 00:09:30 ps Exp $
- * $DragonFly: src/sys/platform/pc32/isa/prof_machdep.c,v 1.10 2008/08/02 01:14:43 dillon Exp $
  */
 
 #ifdef GUPROF
@@ -234,7 +233,7 @@ cputime(void)
         */
        delta = prev_count - count;
        prev_count = count;
-       if ((int) delta <= 0)
+       if (delta <= 0)
                return (delta + (timer0_max_count << CPUTIME_CLOCK_I8254_SHIFT));
        return (delta);
 }
index 904bc2e..728692c 100644 (file)
@@ -25,7 +25,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/i386/isa/prof_machdep.c,v 1.14.2.1 2000/08/03 00:09:30 ps Exp $
- * $DragonFly: src/sys/platform/pc64/isa/prof_machdep.c,v 1.1 2008/08/29 17:07:20 dillon Exp $
  */
 
 #ifdef GUPROF
@@ -235,7 +234,7 @@ cputime(void)
         */
        delta = prev_count - count;
        prev_count = count;
-       if ((int) delta <= 0)
+       if (delta <= 0)
                return (delta + (timer0_max_count << CPUTIME_CLOCK_I8254_SHIFT));
        return (delta);
 }
index 12720f1..6035984 100644 (file)
@@ -676,7 +676,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
                        paddr = _bus_dma_extract(pmap, vaddr);
                        if (run_filter(dmat, paddr) != 0)
                                map->pagesneeded++;
-                       vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK));
+                       vaddr += (PAGE_SIZE - (vaddr & PAGE_MASK));
                }
        }
 
index 80f7e93..204407e 100644 (file)
@@ -1521,8 +1521,8 @@ getmemsize(caddr_t kmdp, u_int64_t first)
         * exceeding Maxmem.
         */
        for (i = j = 0; i <= physmap_idx; i += 2) {
-               if (physmap[i+1] > ptoa((vm_paddr_t)Maxmem))
-                       physmap[i+1] = ptoa((vm_paddr_t)Maxmem);
+               if (physmap[i+1] > ptoa(Maxmem))
+                       physmap[i+1] = ptoa(Maxmem);
                physmap[i] = (physmap[i] + PHYSMAP_ALIGN_MASK) &
                             ~PHYSMAP_ALIGN_MASK;
                physmap[i+1] = physmap[i+1] & ~PHYSMAP_ALIGN_MASK;
@@ -1595,7 +1595,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
                        *pte = pa | PG_V | PG_RW | PG_N;
                        cpu_invltlb();
 
-                       tmp = *(int *)ptr;
+                       tmp = *ptr;
                        /*
                         * Test for alternating 1's and 0's
                         */
@@ -1627,7 +1627,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
                        /*
                         * Restore original value.
                         */
-                       *(int *)ptr = tmp;
+                       *ptr = tmp;
 
                        /*
                         * Adjust array of valid/good pages.
index 16c71cb..b1d01af 100644 (file)
@@ -613,7 +613,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
                        paddr = _bus_dma_extract(pmap, vaddr);
                        if (run_filter(dmat, paddr) != 0)
                                map->pagesneeded++;
-                       vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK));
+                       vaddr += (PAGE_SIZE - (vaddr & PAGE_MASK));
                }
        }
 
index 411e47a..c101308 100644 (file)
@@ -225,7 +225,7 @@ fuword(const void *base)
        long v;
 
        if (copyin(base, &v, sizeof(v)) == 0)
-               return((long)v);
+               return(v);
        return(-1);
 }
 
index 5b71ec2..74c6980 100644 (file)
@@ -609,7 +609,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
                        paddr = _bus_dma_extract(pmap, vaddr);
                        if (run_filter(dmat, paddr) != 0)
                                map->pagesneeded++;
-                       vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK));
+                       vaddr += (PAGE_SIZE - (vaddr & PAGE_MASK));
                }
        }
 
index 464f49e..ac11eb7 100644 (file)
@@ -225,7 +225,7 @@ fuword(const void *base)
        long v;
 
        if (copyin(base, &v, sizeof(v)) == 0)
-               return((long)v);
+               return(v);
        return(-1);
 }
 
index 38b36bb..e871124 100644 (file)
@@ -1845,7 +1845,7 @@ pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va)
                m = PHYS_TO_VM_PAGE(oldpte);
                if (oldpte & VPTE_M) {
 #if defined(PMAP_DIAGNOSTIC)
-                       if (pmap_nw_modified((pt_entry_t) oldpte)) {
+                       if (pmap_nw_modified(oldpte)) {
                                kprintf("pmap_remove: modified page not "
                                        "writable: va: 0x%lx, pte: 0x%lx\n",
                                        va, oldpte);