mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05: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 (cherry picked from commit b5e0cc2fa44f52f16fc0b9c3f1709bc0f43fe2d0)
This commit is contained in:
parent
7c3092e343
commit
60a4a8532b
2 changed files with 1 additions and 2 deletions
|
|
@ -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