kernel: Remove some bogus casts to the own type.
authorSascha Wildner <saw@online.de>
Thu, 24 May 2012 17:26:08 +0000 (19:26 +0200)
committerSascha Wildner <saw@online.de>
Thu, 24 May 2012 17:27:18 +0000 (19:27 +0200)
sys/dev/disk/amd/amd.c
sys/dev/disk/dm/device-mapper.c
sys/dev/disk/dm/dm_ioctl.c
sys/dev/disk/dm/targets/crypt/dm_target_crypt.c
sys/dev/disk/mpt/mpt_debug.c
sys/dev/disk/sym/sym_hipd.c
sys/dev/disk/trm/trm.c

index 89ab87f..495666c 100644 (file)
@@ -1927,7 +1927,7 @@ SRBdone(struct amd_softc *amd, struct amd_srb *pSRB)
                                        ptr2++;
                                }
                                /* ??????? */
-                               pcsio->resid = (u_int32_t) swlval;
+                               pcsio->resid = swlval;
 
 #ifdef AMD_DEBUG0
                                kprintf("XferredLen=%8x,NotYetXferLen=%8x,",
index 2b13ba2..510b8c0 100644 (file)
@@ -347,7 +347,7 @@ disk_ioctl_switch(cdev_t dev, u_long cmd, void *data)
        {
                struct partinfo *dpart;
                u_int64_t size;
-               dpart = (void *)data;
+               dpart = data;
                bzero(dpart, sizeof(*dpart));
 
                if ((dmv = dev->si_drv1) == NULL)
index 1d31631..61ad816 100644 (file)
@@ -745,7 +745,7 @@ dm_table_load_ioctl(prop_dictionary_t dm_dict)
                 * use it.
                 */
                prop_dictionary_get_cstring(target_dict,
-                   DM_TABLE_PARAMS, (char **) &str);
+                   DM_TABLE_PARAMS, &str);
 
                if (SLIST_EMPTY(tbl))
                        /* insert this table to head */
index d583c93..24a86a8 100644 (file)
@@ -1459,7 +1459,7 @@ dmtc_crypto_cb_dump_done(struct cryptop *crp)
        n = atomic_fetchadd_int(&dump_helper->sectors, -1);
 
        if (n == 1) {
-               priv = (dm_target_crypt_config_t *)dump_helper->priv;
+               priv = dump_helper->priv;
                atomic_add_int(dump_helper->ident, 1);
                wakeup(dump_helper);
        }
index 34cef47..81c42d9 100644 (file)
@@ -506,7 +506,7 @@ mpt_print_reply(void *vmsg)
                mpt_print_scsi_io_reply((MSG_SCSI_IO_REPLY *)msg);
                break;
        default:
-               mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg);
+               mpt_print_reply_hdr(msg);
                break;
        }
 }
index 54f8f72..ce2b27b 100644 (file)
@@ -755,7 +755,7 @@ static m_addr_t __vtobus(bus_dma_tag_t dev_dmat, void *m)
        mp = ___get_dma_pool(dev_dmat);
        if (mp) {
                vp = mp->vtob[hc];
-               while (vp && (m_addr_t) vp->vaddr != a)
+               while (vp && vp->vaddr != a)
                        vp = vp->next;
        }
        /* Unlock */
@@ -3729,14 +3729,14 @@ static void sym_log_hard_error(hcb_p np, u_short sist, u_char dstat)
                 dsp <= np->scripta_ba + np->scripta_sz) {
                script_ofs      = dsp - np->scripta_ba;
                script_size     = np->scripta_sz;
-               script_base     = (u_char *) np->scripta0;
+               script_base     = np->scripta0;
                script_name     = "scripta";
        }
        else if (np->scriptb_ba < dsp &&
                 dsp <= np->scriptb_ba + np->scriptb_sz) {
                script_ofs      = dsp - np->scriptb_ba;
                script_size     = np->scriptb_sz;
-               script_base     = (u_char *) np->scriptb0;
+               script_base     = np->scriptb0;
                script_name     = "scriptb";
        } else {
                script_ofs      = dsp;
index 635cfad..d3e72e5 100644 (file)
@@ -1339,12 +1339,12 @@ trm_Interrupt(void *vpACB)
                if (pDCB->DCBFlag & ABORT_DEV_)
                                trm_EnableMsgOutAbort1(pACB, pSRB);
                phase = (u_int16_t) pSRB->ScsiPhase;  /* phase: */
-               stateV = (void *) trm_SCSI_phase0[phase];
+               stateV = trm_SCSI_phase0[phase];
                stateV(pACB, pSRB, &scsi_status);
                pSRB->ScsiPhase = scsi_status & PHASEMASK; 
                /* phase:0,1,2,3,4,5,6,7 */
                phase = (u_int16_t) scsi_status & PHASEMASK;       
-               stateV = (void *) trm_SCSI_phase1[phase];
+               stateV = trm_SCSI_phase1[phase];
                stateV(pACB, pSRB, &scsi_status);  
        }
 }