Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp928989pxb; Fri, 15 Oct 2021 20:29:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD8R25pEALpzwqJ2ZvjZv60uDK/MFBDPqqfeq5xGSnWvTmUCRjQCisK+uVVtX8p7mM8OF6 X-Received: by 2002:a17:907:961a:: with SMTP id gb26mr9896625ejc.23.1634354952759; Fri, 15 Oct 2021 20:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634354952; cv=none; d=google.com; s=arc-20160816; b=SnaEF1cDDGmHxLdOp669Zy2C6agG/zBsdPiMNTj5V5TVJiB5mpwDdL+644CCfBezgS EJsSj13CDfgCU/AmKhHY1cCsl5d2iJZtPJ1sEZSA5Np9idunvrpmMVcznaNheUEZIQZh RuIWc3wntxK44WZR8Nve86lowU2Ue3oVrEjx59mI1FmiFp2pg11qr5ZM4mlZeWFzoOaj AAeIgkjnpko4hfODVmVznFiAFFbpBdehthdqpigXCfrWEpiufReO5vwqv2ZMH/0rtSK+ c3VBsCFbs4ZawfMvCqh3PWWRnlIonewVyBgt2p4EDlNl/nCrgR7w4UV/wC+9nsQ/vC0V 0+sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BKgbBbllKYLOnYYBWfUPT+0UJFGXr6hxe1bIf87m+Wo=; b=nnfnxVv6p4iTHr2rj68VK876eF3tZvqOcDE8oxOh6D6mYF5NXGrA5QStXkm2h1+P2q 3BeG78N8a7Yyi+QZbl27Ya63NX4L48Au2RiJOtmsQDJWjSq1FOqP13XuPbbeLXrWo9dG 2vaoD8v3p0xe8mYr+tPhn4+crhN2gkEgCedkSpJQD/msTRQ0LFKCQOD//2eC6eiA8hRT NzIG4bKSRwMCibJd3EjaRnlKucTVnMOFh19VVDEnSsCm2b+OC/wJLMFIYVaJ2D4Dy05v MJ06J4JaVKT2+cIqUw2zs6DGd7/mYuC3nSISl4RRHcMHiYIEqB0YiLgfX6gPR9m2YAuF 5IXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SoNpANbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga19si13890967ejc.73.2021.10.15.20.28.48; Fri, 15 Oct 2021 20:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SoNpANbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239243AbhJONKZ (ORCPT + 99 others); Fri, 15 Oct 2021 09:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236523AbhJONKX (ORCPT ); Fri, 15 Oct 2021 09:10:23 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64313C061570 for ; Fri, 15 Oct 2021 06:08:17 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id x1so7614386iof.7 for ; Fri, 15 Oct 2021 06:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BKgbBbllKYLOnYYBWfUPT+0UJFGXr6hxe1bIf87m+Wo=; b=SoNpANbU5l3QtOW/vGGOLfrraUHtPPFJHwbst3D088WlVHAwDQjXeAQOCBNympFuKB 9gBQ8xWQQrbimJRhzJUQ3Ch0P7Om/vBIS/Pu+CCde7f2dawgpCWb4VH1c8gvnbW7TUz1 uB5XbS1uNj5KY4pLVxEdSiqywlTSNwgUv4GVJTVE2/4tzVbks8fw/bUPspU4fPRs64zA FejgjqEYfiTblKpKTRDNuStXNG1FMjHGo7bIIPIM5CQ0Jl9NCqmihcjL/taeZnl8Ls+9 XohSn/zfQK1/REUxttESjLCYspoGymF3dxq00NZ0w53mj28RB8opkG+Ct3TVrR71ffei vE4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BKgbBbllKYLOnYYBWfUPT+0UJFGXr6hxe1bIf87m+Wo=; b=YgJaijUKjfxmcEaSu0GmK7X2Xgh58L3QNo52zDbLEZvmlY9Ct69ITNKRbjZEclELTM mu0x145ezwpHNHwoqxNSggGlx3IzBuZinOwUFzrT3kBiE4noFFSwzqSXFLu9aHnQc7tE IUhjVpY4175ejEtvlR1ZyhMsP1gdjFtXkKOzx2Uv6e4adPweoD25IXC2sfQNgcHLyA4k FjdPww5QIS7I380vKdMqsd75Cvfw2hnoepoQJ3NI1ThJPu1xCASsYnOfSjzZIfrFGDD+ 0FIH9FkClC636Z+mniKJWGuex+BfHHHOC2Ag26+bX5x+0M7sRP6F7FXbk1rHzJh+h1s5 g/9A== X-Gm-Message-State: AOAM531SqDwmlhJcdN5VC3frLvma2rOG/Bna7ODaB4A9lqUH7oG2H60L 8IDwk0xXuUNR5WVRuS+gDROC1lTF82CITPsKAWg= X-Received: by 2002:a5d:9d56:: with SMTP id k22mr3555793iok.177.1634303296843; Fri, 15 Oct 2021 06:08:16 -0700 (PDT) MIME-Version: 1.0 References: <20211015090530.2774079-1-linux@rasmusvillemoes.dk> In-Reply-To: <20211015090530.2774079-1-linux@rasmusvillemoes.dk> From: Miguel Ojeda Date: Fri, 15 Oct 2021 15:08:05 +0200 Message-ID: Subject: Re: [PATCH] linux/container_of.h: switch to static_assert To: Rasmus Villemoes Cc: Andrew Morton , Andy Shevchenko , Nick Desaulniers , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 15, 2021 at 11:05 AM Rasmus Villemoes wrote: > > _Static_assert() is evaluated already in the compiler's frontend, and > gives a somehat more to-the-point error, compared to the BUILD_BUG_ON > macro, which only fires after the optimizer has had a chance to > eliminate calls to functions marked with > __attribute__((error)). In theory, this might make builds a tiny bit > faster. Thanks for this! Very much in favor! Reviewed-by: Miguel Ojeda Perhaps Andrew may want to add a link to the related discussion thread: https://lore.kernel.org/lkml/20211014132331.GA4811@kernel.org/T/ Cheers, Miguel