From be97fc8dced052f824387a1ae6a0063f9dcfdc89 Mon Sep 17 00:00:00 2001 From: Ka Ho Ng Date: Tue, 23 Mar 2021 16:11:56 +0800 Subject: [PATCH] bhyve amd: Small cleanups in amdvi_dump_cmds Bump offset with MOD_INC instead in amdvi_dump_cmds. Reviewed by: jhb Approved by: philip (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28862 --- sys/amd64/vmm/amd/amdvi_hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c index 3fe84cc1445a..3581b43ea4de 100644 --- a/sys/amd64/vmm/amd/amdvi_hw.c +++ b/sys/amd64/vmm/amd/amdvi_hw.c @@ -515,8 +515,7 @@ amdvi_dump_cmds(struct amdvi_softc *softc, int count) printf(" [CMD%d, off:0x%x] opcode= 0x%x 0x%x" " 0x%x 0x%lx\n", i, off, cmd->opcode, cmd->word0, cmd->word1, cmd->addr); - off = (off + sizeof(struct amdvi_cmd)) % - (softc->cmd_max * sizeof(struct amdvi_cmd)); + off = MOD_INC(off, sizeof(struct amdvi_cmd), softc->cmd_max); } }