Date: Mon, 23 Aug 2021 18:38:17 GMT From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: e72e16c55df4 - main - Remove bzero declaration Message-ID: <202108231838.17NIcHYR006116@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e72e16c55df48194c354e82bd31415529c7a92a9 commit e72e16c55df48194c354e82bd31415529c7a92a9 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-08-23 16:20:53 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-08-23 18:38:05 +0000 Remove bzero declaration The kernel was migrated to memset in ba96f37758412151 ("Use __builtin for various mem* and b* (e.g. bzero) routines.") and there are no remaining architectures using the file. malloc is augmented to prevent KMSAN from breaking. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/sys/malloc.h | 2 +- sys/sys/systm.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 3d88460a751e..b83d78a18444 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -233,7 +233,7 @@ void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like _malloc_item = malloc(_size, type, (flags) &~ M_ZERO); \ if (((flags) & M_WAITOK) != 0 || \ __predict_true(_malloc_item != NULL)) \ - bzero(_malloc_item, _size); \ + memset(_malloc_item, 0, _size); \ } else { \ _malloc_item = malloc(_size, type, flags); \ } \ diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 1be8f1ac49be..17d1e8933997 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -342,7 +342,6 @@ void hexdump(const void *ptr, int length, const char *hdr, int flags); #define ovbcopy(f, t, l) bcopy((f), (t), (l)) void bcopy(const void * _Nonnull from, void * _Nonnull to, size_t len); -void bzero(void * _Nonnull buf, size_t len); void explicit_bzero(void * _Nonnull, size_t); void *memset(void * _Nonnull buf, int c, size_t len);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108231838.17NIcHYR006116>