From nobody Tue Apr 16 20:13:06 2024 X-Original-To: dev-commits-src-branches@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 4VJwFt3PzYz5H0fD; Tue, 16 Apr 2024 20:13:06 +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 4VJwFt1H8tz4tdc; Tue, 16 Apr 2024 20:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713298386; 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=rbIJwqNYKfCDrygrewhnSryq+BJlPLwBZhYvKhadi7U=; b=LA3yTKqths9ZzaEdDXInqcntP/rTopbYWWxlczMSv8f4SEEkPAOSeFUS8AS850kw2THEzi YHkuYeW6yV07Ob4MK2ikVPIHMsqj2CCwU5gtR2EgZN+s3jLGffFvAASVoClnx87B2v7gxE +6YzLlync5vmZ3dJWN4kHUsFjAd46n7rm6SFsSPMqJQK2s8Ud603eQ1984Dk/MyHT4vAqN vdCiVRoUt5QoONIzDFf8w1eSuuo1paTXCcCS9Q9kpUf9nmqW6x49q+IYsnmUvAwL9S65az 143ay+PfX57nE29rqYlHUFS0mViZEaHfauIiIAPmdwcf878xjc01WIiH4SSG8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713298386; a=rsa-sha256; cv=none; b=WwuWzaJrkMYizP77xIAC1JxQZMXgyhk7tvZzIp89AaMz4xCbJZ7/Iw7OpZ4z4TQb5k7NG/ zixbgQH+8FRpUpwf2MXFC6VdFRocb6ujjAPwEeUGJMbGO9MZ8GIyTyA3Hx37UUSYJZq7LT N0poA5oJPSNs7QS41TvVNp5Ah4cyxvC8PZHpuCfpxr7JSCh4cvwnl+hAh4wbYtZNXL3IXy HJMVrqG67ScsroFkcvwNSYLfZgd4ydx1PGx7+1sQLTkcOdTTbgAPKFj3TVVj7Rhjn0IlNa sHzqVY8QkMmcWpq/82EnsQdv3qUNlfKvQDBdOykFVY+eYz9JHDb5FpdFC+5pQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713298386; 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=rbIJwqNYKfCDrygrewhnSryq+BJlPLwBZhYvKhadi7U=; b=sPVAelxN28722eUELTPwcLKusObFnvvR/vcuGFsj+jss/+cvlS5eRsgy3yeO8XoZ5ubU38 ANi+KVImUmsR+X/W709QJrZUEH16osSOcHqPBUXPKB2RecYl7L/Z4Dp+FfeHg6iUhphP32 R1GqrXwO4LNqQdHLYmwcO9B4BQSlKagewraZLxIrT+MofGkAZywH3oLy608L51rkqssG+k 48l528TvxqrJtww8Uhl0XxC71d7RcAvSIo6GVQn4IGRJNX01BdeiRgzVA1Y14DXw+pn0c4 RLJzkkBnaspJBalCeQLfCUrBlGLLrg2MX6KCwUi89JyaTDBy28txSQW/U2NwOQ== 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 4VJwFt0vfRzxPQ; Tue, 16 Apr 2024 20:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43GKD64R038714; Tue, 16 Apr 2024 20:13:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43GKD6mA038711; Tue, 16 Apr 2024 20:13:06 GMT (envelope-from git) Date: Tue, 16 Apr 2024 20:13:06 GMT Message-Id: <202404162013.43GKD6mA038711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e9620c27f176 - stable/14 - loader: Retire CTASSERT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e9620c27f176ef66abe128bcb17df37eac46c6e6 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e9620c27f176ef66abe128bcb17df37eac46c6e6 commit e9620c27f176ef66abe128bcb17df37eac46c6e6 Author: Warner Losh AuthorDate: 2024-02-21 15:48:32 +0000 Commit: Warner Losh CommitDate: 2024-04-16 19:54:26 +0000 loader: Retire CTASSERT The project is moving away from CTASSERT in favor of _Static_assert. Cleanup the few instances in the loader proactively. Sponsored by: Netflix Reviewed by: manu, tsoome Differential Revision: https://reviews.freebsd.org/D44006 (cherry picked from commit 32568e5f2435a2539b0c4177a6fefe7a9e0a0c89) --- stand/common/bootstrap.h | 4 ---- stand/efi/loader/arch/amd64/multiboot2.c | 2 +- stand/i386/libi386/multiboot.c | 2 +- stand/i386/loader/main.c | 9 ++++----- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index 7387569ad65a..b7d6e538f9be 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -382,8 +382,4 @@ int gen_setcurrdev(struct env_var *ev, int flags, const void *value); int mount_currdev(struct env_var *, int, const void *); void set_currdev(const char *devname); -#ifndef CTASSERT -#define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") -#endif - #endif /* !_BOOTSTRAP_H_ */ diff --git a/stand/efi/loader/arch/amd64/multiboot2.c b/stand/efi/loader/arch/amd64/multiboot2.c index 4d7b2713685d..6c96d7dc0073 100644 --- a/stand/efi/loader/arch/amd64/multiboot2.c +++ b/stand/efi/loader/arch/amd64/multiboot2.c @@ -334,7 +334,7 @@ exec(struct preloaded_file *fp) struct mb2hdr *hdr; - CTASSERT(sizeof(header) <= PAGE_SIZE); + _Static_assert(sizeof(header) <= PAGE_SIZE, "header too big"); if ((md = file_findmetadata(fp, MODINFOMD_NOCOPY | MODINFOMD_MB2HDR)) == NULL) { diff --git a/stand/i386/libi386/multiboot.c b/stand/i386/libi386/multiboot.c index e11da0444fcd..b69895de9706 100644 --- a/stand/i386/libi386/multiboot.c +++ b/stand/i386/libi386/multiboot.c @@ -165,7 +165,7 @@ multiboot_exec(struct preloaded_file *fp) int error, mod_num; struct xen_header header; - CTASSERT(sizeof(header) <= PAGE_SIZE); + _Static_assert(sizeof(header) <= PAGE_SIZE, "header too large for page"); /* * Don't pass the memory size found by the bootloader, the memory diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index 97c4448afdc3..8a3c1cbc6a42 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -51,14 +51,13 @@ #include "libzfs.h" #endif -CTASSERT(sizeof(struct bootargs) == BOOTARGS_SIZE); -CTASSERT(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO); -CTASSERT(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS); -CTASSERT(offsetof(struct bootinfo, bi_size) == BI_SIZE); +_Static_assert(sizeof(struct bootargs) == BOOTARGS_SIZE, "Bootarg size bad"); +_Static_assert(offsetof(struct bootargs, bootinfo) == BA_BOOTINFO, "BA_BOOTINFO"); +_Static_assert(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS, "BA_BOOTFLAGS"); +_Static_assert(offsetof(struct bootinfo, bi_size) == BI_SIZE, "BI_SIZE"); /* Arguments passed in from the boot1/boot2 loader */ static struct bootargs *kargs; - static uint32_t initial_howto; static uint32_t initial_bootdev; static struct bootinfo *initial_bootinfo;