diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c --- a/sys/dev/aic7xxx/aic7xxx.c +++ b/sys/dev/aic7xxx/aic7xxx.c @@ -4931,7 +4931,6 @@ for (i = 0; i < AHC_TMODE_CMDS; i++) ahc->targetcmds[i].cmd_valid = 0; ahc_sync_tqinfifo(ahc, BUS_DMASYNC_PREREAD); - ahc->qoutfifo = (uint8_t *)&ahc->targetcmds[256]; } ahc->qinfifo = &ahc->qoutfifo[256]; diff --git a/sys/dev/aic7xxx/aic7xxx_inline.h b/sys/dev/aic7xxx/aic7xxx_inline.h --- a/sys/dev/aic7xxx/aic7xxx_inline.h +++ b/sys/dev/aic7xxx/aic7xxx_inline.h @@ -217,7 +217,7 @@ static __inline uint32_t ahc_targetcmd_offset(struct ahc_softc *ahc, u_int index) { - return (((uint8_t *)&ahc->targetcmds[index]) - ahc->qoutfifo); + return (((uint8_t *)&ahc->targetcmds[index]) - (uint8_t *)ahc->targetcmds); } /******************************** Debugging ***********************************/