Date: Wed, 12 Jul 2006 04:02:16 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 101325 for review Message-ID: <200607120402.k6C42Gcf051061@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101325 Change 101325 by kmacy@kmacy_storage:sun4v_work_stable on 2006/07/12 04:01:15 - calls to bus_space_* functions do not need endian conversion - gcc will silently lose information without an explicit cast and will not give any warnings! Affected files ... .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.c#4 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.h#4 edit Differences ... ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.c#4 (text+ko) ==== @@ -1373,7 +1373,7 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout1\n"); return ETIMEDOUT; } - *data16++ = mpt_read(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; + *data16++ = (u_int16_t)mpt_read(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); /* Get Second Word */ @@ -1381,7 +1381,7 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout2\n"); return ETIMEDOUT; } - *data16++ = mpt_read(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; + *data16++ = (u_int16_t)mpt_read(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); /* @@ -1411,7 +1411,7 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout3\n"); return ETIMEDOUT; } - datum = mpt_read(mpt, MPT_OFFSET_DOORBELL); + datum = (u_int16_t)mpt_read(mpt, MPT_OFFSET_DOORBELL); if (reply_left-- > 0) *data16++ = datum & MPT_DB_DATA_MASK; ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.h#4 (text+ko) ==== @@ -825,13 +825,13 @@ static __inline void mpt_write(struct mpt_softc *mpt, size_t offset, uint32_t val) { - bus_space_write_4(mpt->pci_st, mpt->pci_sh, offset, htole32(val)); + bus_space_write_4(mpt->pci_st, mpt->pci_sh, offset, val); } static __inline uint32_t mpt_read(struct mpt_softc *mpt, int offset) { - return (le32toh(bus_space_read_4(mpt->pci_st, mpt->pci_sh, offset))); + return (bus_space_read_4(mpt->pci_st, mpt->pci_sh, offset)); } /* @@ -843,14 +843,14 @@ mpt_pio_write(struct mpt_softc *mpt, size_t offset, uint32_t val) { bus_space_write_4(mpt->pci_pio_st, mpt->pci_pio_sh, offset, - htole32(val)); + val); } static __inline uint32_t mpt_pio_read(struct mpt_softc *mpt, int offset) { - return (le32toh(bus_space_read_4(mpt->pci_pio_st, mpt->pci_pio_sh, - offset))); + return (bus_space_read_4(mpt->pci_pio_st, mpt->pci_pio_sh, + offset)); } /*********************** Reply Frame/Request Management ***********************/ /* Max MPT Reply we are willing to accept (must be power of 2) */ @@ -1010,7 +1010,7 @@ static __inline request_t * mpt_tag_2_req(struct mpt_softc *mpt, uint32_t tag) { - uint16_t rtg = (tag >> 18); + uint16_t rtg = (uint16_t)(tag >> 18); KASSERT(rtg < mpt->tgt_cmds_allocated, ("bad tag %d\n", tag)); KASSERT(mpt->tgt_cmd_ptrs, ("no cmd backpointer array")); KASSERT(mpt->tgt_cmd_ptrs[rtg], ("no cmd backpointer"));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607120402.k6C42Gcf051061>