From nobody Tue Dec 28 17:51:05 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A6700190F348; Tue, 28 Dec 2021 17:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JNhsj30R3z3Dvq; Tue, 28 Dec 2021 17:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4719015F39; Tue, 28 Dec 2021 17:51:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BSHp5cx051046; Tue, 28 Dec 2021 17:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BSHp5wd051028; Tue, 28 Dec 2021 17:51:05 GMT (envelope-from git) Date: Tue, 28 Dec 2021 17:51:05 GMT Message-Id: <202112281751.1BSHp5wd051028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2cee5861898d - main - sys/kern: Use C99 fixed-width integer types. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cee5861898daea5bbc2427d0e67d15559564683 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640713865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZBUcH/62OgFEOnX1SHYCTBA9fVtS/QIEQQQ3CaOJHq4=; b=Pmm+8F969FA8luKSQ92Q6hnZ8XtOIlYadsilGwaDyFFZTvlrAOhyHkQ0HIODn16zxIsrOD oNvE/irk7Xiy2MJvmhiYvlBCPeop9lvGzlJfuXEk6Q2Glbe61a8El+phlXBq184H7BI78U f++D7H7Pq0YccU1J2hpeVmPxQWf6q3J5g0oAypV+GZy2LeSo8NkGv/SoyhItdRwVbjLVsx PLQIp/WYMnTOAskrMTCWSRANkUS2lwrRA84J+mbLUtRvuTyY/6WISrN0n/N3hUHGSmVFQ0 B/Pfr8907ZMea6hiLMjnIByOBkZmKvORiJoD6+lqlH6nRuE1CSPjDQSG1zDbeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640713865; a=rsa-sha256; cv=none; b=gldPs/NuH1TYM2R8nMaOuxTggWpe6ahtdsvlHq9xf3hoxgFf9anj57Rzn3Fiy+EqjAfoRp OlIk32txXeN69TKq63XMQ1cqv9KB6dKd+4SS7NtghcgqwPuZefbl5RiAhmYC5+5le7FK6J twfxHug/bnJRBqn+j5IDfNd5tcsDECd2yEgWf4iAN+vII7rCCnbkgxej+PPLDC//Ka2dda 7aenLFSL/2DYnAvujq2FnJmVfaL3NrAKss1VjX9XizQB/XeSob+kRP62Ri0kT4OK1etOP/ kEgb+A3o9a5eyFEoaWSG4RlicRipay8iIQcZvNUKW9DTtd9RibxM8bRfOpCJfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2cee5861898daea5bbc2427d0e67d15559564683 commit 2cee5861898daea5bbc2427d0e67d15559564683 Author: John Baldwin AuthorDate: 2021-12-28 17:41:08 +0000 Commit: John Baldwin CommitDate: 2021-12-28 17:41:08 +0000 sys/kern: Use C99 fixed-width integer types. No functional change. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D33630 --- sys/kern/kern_syscalls.c | 6 +++--- sys/kern/md4c.c | 4 ++-- sys/kern/md5c.c | 28 ++++++++++++++-------------- sys/kern/subr_atomic64.c | 22 +++++++++++----------- sys/kern/subr_busdma_bufalloc.c | 2 +- sys/kern/vfs_lookup.c | 2 +- sys/kern/vfs_syscalls.c | 4 ++-- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c index b4fec879708a..4b191eabbe04 100644 --- a/sys/kern/kern_syscalls.c +++ b/sys/kern/kern_syscalls.c @@ -66,7 +66,7 @@ lkmressys(struct thread *td, struct nosys_args *args) static void syscall_thread_drain(struct sysent *se) { - u_int32_t cnt, oldcnt; + uint32_t cnt, oldcnt; do { oldcnt = se->sy_thrcnt; @@ -82,7 +82,7 @@ syscall_thread_drain(struct sysent *se) int syscall_thread_enter(struct thread *td, struct sysent *se) { - u_int32_t cnt, oldcnt; + uint32_t cnt, oldcnt; KASSERT((se->sy_thrcnt & SY_THR_STATIC) == 0, ("%s: not a static syscall", __func__)); @@ -99,7 +99,7 @@ syscall_thread_enter(struct thread *td, struct sysent *se) void syscall_thread_exit(struct thread *td, struct sysent *se) { - u_int32_t cnt, oldcnt; + uint32_t cnt, oldcnt; KASSERT((se->sy_thrcnt & SY_THR_STATIC) == 0, ("%s: not a static syscall", __func__)); diff --git a/sys/kern/md4c.c b/sys/kern/md4c.c index 68d19485b433..86d6a5a2c7f7 100644 --- a/sys/kern/md4c.c +++ b/sys/kern/md4c.c @@ -33,8 +33,8 @@ __FBSDID("$FreeBSD$"); #include typedef unsigned char *POINTER; -typedef u_int16_t UINT2; -typedef u_int32_t UINT4; +typedef uint16_t UINT2; +typedef uint32_t UINT4; #define PROTO_LIST(list) list diff --git a/sys/kern/md5c.c b/sys/kern/md5c.c index 3e0165a45337..175bd38aeee1 100644 --- a/sys/kern/md5c.c +++ b/sys/kern/md5c.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -static void MD5Transform(u_int32_t [4], const unsigned char [64]); +static void MD5Transform(uint32_t [4], const unsigned char [64]); #if (BYTE_ORDER == LITTLE_ENDIAN) #define Encode memcpy @@ -52,12 +52,12 @@ static void MD5Transform(u_int32_t [4], const unsigned char [64]); #else /* - * Encodes input (u_int32_t) into output (unsigned char). Assumes len is + * Encodes input (uint32_t) into output (unsigned char). Assumes len is * a multiple of 4. */ static void -Encode (unsigned char *output, u_int32_t *input, unsigned int len) +Encode (unsigned char *output, uint32_t *input, unsigned int len) { unsigned int i; uint32_t ip; @@ -72,12 +72,12 @@ Encode (unsigned char *output, u_int32_t *input, unsigned int len) } /* - * Decodes input (unsigned char) into output (u_int32_t). Assumes len is + * Decodes input (unsigned char) into output (uint32_t). Assumes len is * a multiple of 4. */ static void -Decode (u_int32_t *output, const unsigned char *input, unsigned int len) +Decode (uint32_t *output, const unsigned char *input, unsigned int len) { unsigned int i; @@ -108,22 +108,22 @@ static unsigned char PADDING[64] = { * Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } @@ -163,10 +163,10 @@ MD5Update (context, in, inputLen) index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ - if ((context->count[0] += ((u_int32_t)inputLen << 3)) - < ((u_int32_t)inputLen << 3)) + if ((context->count[0] += ((uint32_t)inputLen << 3)) + < ((uint32_t)inputLen << 3)) context->count[1]++; - context->count[1] += ((u_int32_t)inputLen >> 29); + context->count[1] += ((uint32_t)inputLen >> 29); partLen = 64 - index; @@ -233,10 +233,10 @@ MD5Final(unsigned char digest[static MD5_DIGEST_LENGTH], MD5_CTX *context) static void MD5Transform (state, block) - u_int32_t state[4]; + uint32_t state[4]; const unsigned char block[64]; { - u_int32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16]; + uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode (x, block, 64); diff --git a/sys/kern/subr_atomic64.c b/sys/kern/subr_atomic64.c index 5dffb161e8f2..66d2d4924d35 100644 --- a/sys/kern/subr_atomic64.c +++ b/sys/kern/subr_atomic64.c @@ -80,8 +80,8 @@ static struct mtx a64_mtx_pool[A64_POOL_SIZE]; #define ATOMIC64_EMU_UN(op, rt, block, ret) \ rt \ - atomic_##op##_64(volatile u_int64_t *p) { \ - u_int64_t tmp __unused; \ + atomic_##op##_64(volatile uint64_t *p) { \ + uint64_t tmp __unused; \ LOCK_A64(); \ block; \ UNLOCK_A64(); \ @@ -89,8 +89,8 @@ static struct mtx a64_mtx_pool[A64_POOL_SIZE]; #define ATOMIC64_EMU_BIN(op, rt, block, ret) \ rt \ - atomic_##op##_64(volatile u_int64_t *p, u_int64_t v) { \ - u_int64_t tmp __unused; \ + atomic_##op##_64(volatile uint64_t *p, uint64_t v) { \ + uint64_t tmp __unused; \ LOCK_A64(); \ block; \ UNLOCK_A64(); \ @@ -98,16 +98,16 @@ static struct mtx a64_mtx_pool[A64_POOL_SIZE]; ATOMIC64_EMU_BIN(add, void, (*p = *p + v), return); ATOMIC64_EMU_BIN(clear, void, *p &= ~v, return); -ATOMIC64_EMU_BIN(fetchadd, u_int64_t, (*p = *p + v, v = *p - v), return (v)); -ATOMIC64_EMU_UN(load, u_int64_t, (tmp = *p), return (tmp)); +ATOMIC64_EMU_BIN(fetchadd, uint64_t, (*p = *p + v, v = *p - v), return (v)); +ATOMIC64_EMU_UN(load, uint64_t, (tmp = *p), return (tmp)); ATOMIC64_EMU_BIN(set, void, *p |= v, return); ATOMIC64_EMU_BIN(subtract, void, (*p = *p - v), return); ATOMIC64_EMU_BIN(store, void, *p = v, return); -ATOMIC64_EMU_BIN(swap, u_int64_t, tmp = *p; *p = v; v = tmp, return(v)); +ATOMIC64_EMU_BIN(swap, uint64_t, tmp = *p; *p = v; v = tmp, return(v)); -int atomic_cmpset_64(volatile u_int64_t *p, u_int64_t old, u_int64_t new) +int atomic_cmpset_64(volatile uint64_t *p, uint64_t old, uint64_t new) { - u_int64_t tmp; + uint64_t tmp; LOCK_A64(); tmp = *p; @@ -118,9 +118,9 @@ int atomic_cmpset_64(volatile u_int64_t *p, u_int64_t old, u_int64_t new) return (tmp == old); } -int atomic_fcmpset_64(volatile u_int64_t *p, u_int64_t *old, u_int64_t new) +int atomic_fcmpset_64(volatile uint64_t *p, uint64_t *old, uint64_t new) { - u_int64_t tmp, tmp_old; + uint64_t tmp, tmp_old; LOCK_A64(); tmp = *p; diff --git a/sys/kern/subr_busdma_bufalloc.c b/sys/kern/subr_busdma_bufalloc.c index fea141908399..f201cde51519 100644 --- a/sys/kern/subr_busdma_bufalloc.c +++ b/sys/kern/subr_busdma_bufalloc.c @@ -74,7 +74,7 @@ struct busdma_bufalloc { busdma_bufalloc_t busdma_bufalloc_create(const char *name, bus_size_t minimum_alignment, - uma_alloc alloc_func, uma_free free_func, u_int32_t zcreate_flags) + uma_alloc alloc_func, uma_free free_func, uint32_t zcreate_flags) { struct busdma_bufalloc *ba; struct busdma_bufzone *bz; diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index d05e1658a004..e91a43572cbd 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1618,7 +1618,7 @@ void NDVALIDATE(struct nameidata *ndp) { struct componentname *cnp; - u_int64_t used, orig; + uint64_t used, orig; cnp = &ndp->ni_cnd; orig = cnp->cn_origflags; diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 00da4e7c1b07..3e0b96051465 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -114,7 +114,7 @@ static int kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, static uint64_t at2cnpflags(u_int at_flags, u_int mask) { - u_int64_t res; + uint64_t res; MPASS((at_flags & (AT_SYMLINK_FOLLOW | AT_SYMLINK_NOFOLLOW)) != (AT_SYMLINK_FOLLOW | AT_SYMLINK_NOFOLLOW)); @@ -3665,7 +3665,7 @@ kern_renameat(struct thread *td, int oldfd, const char *old, int newfd, struct mount *mp = NULL; struct vnode *tvp, *fvp, *tdvp; struct nameidata fromnd, tond; - u_int64_t tondflags; + uint64_t tondflags; int error; again: