From nobody Sat Dec 03 12:31:15 2022 X-Original-To: dev-commits-src-main@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 4NPTh01wrpz4jHfR; Sat, 3 Dec 2022 12:31:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4NPTgz6n7Bz3Hfb; Sat, 3 Dec 2022 12:31:27 +0000 (UTC) (envelope-from hps@selasky.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.69] (unknown [84.210.222.10]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 961DF260133; Sat, 3 Dec 2022 13:31:17 +0100 (CET) Message-ID: <39c15d70-4895-3b3b-cbbd-d0d7eaec0fdb@selasky.org> Date: Sat, 3 Dec 2022 13:31:15 +0100 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: git: da5d0a1dbc28 - main - kboot: Use unsigned long long. To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202212021949.2B2JnpxT077008@gitrepo.freebsd.org> Content-Language: en-US From: Hans Petter Selasky In-Reply-To: <202212021949.2B2JnpxT077008@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4NPTgz6n7Bz3Hfb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 12/2/22 20:49, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=da5d0a1dbc2838eae7033254705c684d7a013fce > > commit da5d0a1dbc2838eae7033254705c684d7a013fce > Author: Warner Losh > AuthorDate: 2022-12-02 19:41:01 +0000 > Commit: Warner Losh > CommitDate: 2022-12-02 19:41:01 +0000 > > kboot: Use unsigned long long. > > For the 64-bit platforms, this is a nop. Currently kboot only supports > 64-bit platforms, though. If we support 32-bit in the future, this will > become important. > > Noticed by: rpokala > Sponsored by: Netflix > --- > stand/kboot/util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/stand/kboot/util.c b/stand/kboot/util.c > index 938aad599e19..7d467a29b059 100644 > --- a/stand/kboot/util.c > +++ b/stand/kboot/util.c > @@ -35,7 +35,7 @@ file2str(const char *fn, char *buffer, size_t buflen) > bool > file2u64(const char *fn, uint64_t *val) > { > - unsigned long v; > + unsigned long long v; > char buffer[80]; > > if (!file2str(fn, buffer, sizeof(buffer))) Why not include stdint.h and use uint64_t ? Instead of building on the good old assumptions, int is 32-bit and long long is 64-bit? It is interesting to observe the sizes of these types in 8-bit compilers :-) Not that it makes a big difference for us. Maybe _Static_assert(sizeof(long long) == 8, "Please fix this code"); --HPS --HPS