Skip to content

Commit

Permalink
kern_malloc: remove '.' and '\n' from KASSERT/panic
Browse files Browse the repository at this point in the history
KASSERT and panic calls should not have a '.' at the end of the message
and do not need '\n'.  Remove these.

No functional changes.

Reported by:	markj (during review of D45812)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	markj, kib
Differential Revision: https://reviews.freebsd.org/D46093
  • Loading branch information
Bjoern A. Zeeb authored and Bjoern A. Zeeb committed Jul 24, 2024
1 parent 9e6544d commit c0df224
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sys/kern/kern_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ malloc_domain(size_t *sizep, int *indxp, struct malloc_type *mtp, int domain,

size = *sizep;
KASSERT(size <= kmem_zmax && (flags & M_EXEC) == 0,
("malloc_domain: Called with bad flag / size combination."));
("malloc_domain: Called with bad flag / size combination"));
if (size & KMEM_ZMASK)
size = (size & ~KMEM_ZMASK) + KMEM_ZBASE;
indx = kmemsize[size >> KMEM_ZSHIFT];
Expand Down Expand Up @@ -996,7 +996,7 @@ zfree(void *addr, struct malloc_type *mtp)

vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab);
if (slab == NULL)
panic("free: address %p(%p) has not been allocated.\n",
panic("free: address %p(%p) has not been allocated",
addr, (void *)((u_long)addr & (~UMA_SLAB_MASK)));

switch (GET_SLAB_COOKIE(slab)) {
Expand Down Expand Up @@ -1162,7 +1162,7 @@ malloc_usable_size(const void *addr)
#else
vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab);
if (slab == NULL)
panic("malloc_usable_size: address %p(%p) is not allocated.\n",
panic("malloc_usable_size: address %p(%p) is not allocated",
addr, (void *)((u_long)addr & (~UMA_SLAB_MASK)));

switch (GET_SLAB_COOKIE(slab)) {
Expand Down

0 comments on commit c0df224

Please sign in to comment.