diff options
Diffstat (limited to 'sys/arch/sun3/dev/xd.c')
-rw-r--r-- | sys/arch/sun3/dev/xd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/sun3/dev/xd.c b/sys/arch/sun3/dev/xd.c index 8c1e42f9b5e..d3a8f835ecb 100644 --- a/sys/arch/sun3/dev/xd.c +++ b/sys/arch/sun3/dev/xd.c @@ -101,7 +101,8 @@ * XDC_HWAIT: add iorq "N" to head of SC's wait queue */ #define XDC_HWAIT(SC, N) { \ - (SC)->waithead = ((SC)->waithead - 1) % XDC_MAXIOPB; \ + (SC)->waithead = ((SC)->waithead == 0) ? \ + (XDC_MAXIOPB - 1) : ((SC)->waithead - 1); \ (SC)->waitq[(SC)->waithead] = (N); \ (SC)->nwait++; \ } |