Date: Sun, 9 Dec 2018 06:48:44 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341761 - stable/12/usr.sbin/bhyve Message-ID: <201812090648.wB96miYo066560@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: araujo Date: Sun Dec 9 06:48:44 2018 New Revision: 341761 URL: https://svnweb.freebsd.org/changeset/base/341761 Log: MFC r340211: Comestic change to try to inline the memset with SSE/AVX instructions. Also switch from int to size_t to keep portability. Reviewed by: brooks Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D17795 Modified: stable/12/usr.sbin/bhyve/pci_nvme.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_nvme.c Sun Dec 9 06:46:53 2018 (r341760) +++ stable/12/usr.sbin/bhyve/pci_nvme.c Sun Dec 9 06:48:44 2018 (r341761) @@ -251,11 +251,13 @@ static void pci_nvme_io_partial(struct blockif_req *br (NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT)) static __inline void -cpywithpad(char *dst, int dst_size, const char *src, char pad) +cpywithpad(char *dst, size_t dst_size, const char *src, char pad) { - int len = strnlen(src, dst_size); + size_t len; + + len = strnlen(src, dst_size); + memset(dst, pad, dst_size); memcpy(dst, src, len); - memset(dst + len, pad, dst_size - len); } static __inline void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812090648.wB96miYo066560>