mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
ahc(4): resolve some minor nits
In ahc_init(), qoutfifo is already assigned to effectively the same value a couple lines up, except in the first assignment it uses the proper definition; keep the more descriptive assignment. ahc_targetcmd_offset() gets the offset wrong entirely; as per the area of ahc_init() this diff also touches, targetcmds is laid out first in the shared map and it's followed by the qoutfifo. As a result, we'd generally be getting negative offsets here. We can't actually do a partial sync anyways, so there was no consequence to getting this wrong. Reviewed by: imp, mav Differential Revision: https://reviews.freebsd.org/D44859
This commit is contained in:
parent
b37333899b
commit
b5e0cc2fa4
|
@ -4931,7 +4931,6 @@ ahc_init(struct ahc_softc *ahc)
|
|||
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];
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ ahc_sync_sglist(struct ahc_softc *ahc, struct scb *scb, int op)
|
|||
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 ***********************************/
|
||||
|
|
Loading…
Reference in a new issue