git: 6391be308944 - main - bhyve nvme: Switch to POSIX standard functions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 17 Aug 2022 00:29:07 UTC
The branch main has been updated by chuck: URL: https://cgit.FreeBSD.org/src/commit/?id=6391be30894460c03a70e0321e99b2bdcda8eebf commit 6391be30894460c03a70e0321e99b2bdcda8eebf Author: Chuck Tuffli <chuck@FreeBSD.org> AuthorDate: 2022-08-17 00:16:06 +0000 Commit: Chuck Tuffli <chuck@FreeBSD.org> CommitDate: 2022-08-17 00:23:27 +0000 bhyve nvme: Switch to POSIX standard functions Switch bzero to memset and bcopy to memcpy Reviewed by: imp, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D36215 --- usr.sbin/bhyve/pci_nvme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index d983125367f2..e180ce0de7ca 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1550,7 +1550,7 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nvme_command* command, dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, sizeof(uint32_t) * 1024); /* All unused entries shall be zero */ - bzero(dest, sizeof(uint32_t) * 1024); + memset(dest, 0, sizeof(uint32_t) * 1024); ((uint32_t *)dest)[0] = 1; break; case 0x03: /* list of NSID structures in CDW1.NSID, 4096 bytes */ @@ -1562,12 +1562,12 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nvme_command* command, dest = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, sizeof(uint32_t) * 1024); /* All bytes after the descriptor shall be zero */ - bzero(dest, sizeof(uint32_t) * 1024); + memset(dest, 0, sizeof(uint32_t) * 1024); /* Return NIDT=1 (i.e. EUI64) descriptor */ ((uint8_t *)dest)[0] = 1; ((uint8_t *)dest)[1] = sizeof(uint64_t); - bcopy(sc->nsdata.eui64, ((uint8_t *)dest) + 4, sizeof(uint64_t)); + memcpy(((uint8_t *)dest) + 4, sc->nsdata.eui64, sizeof(uint64_t)); break; case 0x13: /*