Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1215551rbb; Mon, 26 Feb 2024 02:25:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUF5RpoxWbU7EF+fzMInf9BzJ5IyOxSL9vOB5svbZxSB6lfXsePlEZ+4rlNhu27IqZuso80NPeqVjgdTjAXZEttlqZLFmvJl0OJQgZ2hg== X-Google-Smtp-Source: AGHT+IGJMEWMcpN3skNCgFON00hBNzYhTJdQRIAmLE6rhDL8ML8FHmPU/9q6jYO7s03FP9RUG8fI X-Received: by 2002:a0c:e08b:0:b0:68f:ecde:f13f with SMTP id l11-20020a0ce08b000000b0068fecdef13fmr5828277qvk.22.1708943132049; Mon, 26 Feb 2024 02:25:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708943132; cv=pass; d=google.com; s=arc-20160816; b=eIV1APYbPZKwXLa9JYW/AtgOddARLiQukgJWUAZabE/8cKPCjRMaMjqu67xadisMe7 1X/0iHHeHV2JbAq/M0S4xMVjEck9RAlaNcRk3+fEnHlm2q5lbKYiwGE3f6pFYze0Nz2a pADvQiCyjKLNxqr2VAeum5cf69Weea451kaPsiBO7GtFgy+vyijBxkOS14Hf6DiVlg3f neQ6eWtTioygLpgtqzV02eFQfuhsNlMBidkuVAGH9yniYTDFEGFoFJ353ZDwBIpgVszj RhGyzHj1NMLbnSG9pfAvNODXY+HNQrTnCqvNmtRhWD5Z2d7It8MbpoOlynijTXNckbLU J6tw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=tjXnZ4goM1qumYJwf47U7+WWJdpRRWcTWLqYqEFbbQg=; fh=h0SStpg8CkH+3Eh8Q4HJFYHqsqFWCht/qpmFoicRuWM=; b=A8WP5o67tfLgcwZ93v7nbTzRB18krtenVo/moWlN7TOyohLBuE7AMEISchg2pIZ0oU T1l/GqYkiFOfaHPO7+gyYovNaGAMAAleoNVOxRi3M54VHrNG05t89rDGR7lz5JIPXsI2 IDrsMFsLe+Vub6xOjd1b9Yd/L6b1bVoCS2xnqXqWhIiTafvZmA0hGTM0jCmiSgkDvl6O CluyWBZDdySyPb0nyohP6ZfmVfq1l7gvwFXWNbTRYTzisK6hMQ8K0lKMJXGNJ9Dzsg6B CzILyybYqe+hPW9vbXYbUXO221ntyxiRgClRs9ZOJ08a/Xi7pweV/Y5Mm6OIVfrU573C a8eA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-81130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r5-20020a056214124500b0068f8f1cb83esi4822726qvv.425.2024.02.26.02.25.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:25:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-81130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 38B741C28BFD for ; Mon, 26 Feb 2024 10:23:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0153955C05; Mon, 26 Feb 2024 10:07:11 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88FD81BF3B for ; Mon, 26 Feb 2024 10:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.85.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708942030; cv=none; b=tEIRQVEAvEk6MoGL5lP91qdRpwuwJk+8wVakw1lrcuynx55FTyXQlyHT8Nzv6PbFhdE+u8P+sbg38H//+D5h4bpvvl3F43dNXSv/kCfKII4Si49DQXkXUvfwg0ou+wkxRraRt3ASvpGOXeqDywk2MWABGOpF4Ao/746UzIHz06g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708942030; c=relaxed/simple; bh=tjXnZ4goM1qumYJwf47U7+WWJdpRRWcTWLqYqEFbbQg=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=RDxrYOy5iOH2YdztKCv8t8h4UNYAKZiuapmKrvMA4xKP/VEFWYhcA5jkEjtvMnRUkAMTKdy97QaG6s96q3HJvEAAgtJYutdLsEg5RV9OaQJ71S/F9ehdGF1YSwD7N7S6Slahlitbk7gy8yfUrUs9gbyP6obQiNjL64hvu8neBds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.85.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-28-hJeJAT_oPHyxzCcPYljXKg-1; Mon, 26 Feb 2024 10:07:05 +0000 X-MC-Unique: hJeJAT_oPHyxzCcPYljXKg-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 26 Feb 2024 10:07:04 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Mon, 26 Feb 2024 10:07:04 +0000 From: David Laight To: 'Jani Nikula' , "'linux-kernel@vger.kernel.org'" , "'Linus Torvalds'" , 'Netdev' , "'dri-devel@lists.freedesktop.org'" CC: 'Jens Axboe' , "'Matthew Wilcox (Oracle)'" , 'Christoph Hellwig' , "'linux-btrfs@vger.kernel.org'" , "'Andrew Morton'" , 'Andy Shevchenko' , "'David S . Miller'" , 'Dan Carpenter' , "Rasmus Villemoes" Subject: RE: [PATCH next v2 02/11] minmax: Use _Static_assert() instead of static_assert() Thread-Topic: [PATCH next v2 02/11] minmax: Use _Static_assert() instead of static_assert() Thread-Index: AdpoComWnYboZopTTWeIFfAWCv2rOwAi5neAAAEPFJA= Date: Mon, 26 Feb 2024 10:07:03 +0000 Message-ID: <824b0f70413d4570bcc97b39aad81a93@AcuMS.aculab.com> References: <0fff52305e584036a777f440b5f474da@AcuMS.aculab.com> <8059bc04da1a45bc810ac339a1129a4c@AcuMS.aculab.com> <87v86bo9qi.fsf@intel.com> In-Reply-To: <87v86bo9qi.fsf@intel.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Jani Nikula > Sent: 26 February 2024 09:28 >=20 > On Sun, 25 Feb 2024, David Laight wrote: > > The wrapper just adds two more lines of error output when the test fail= s. >=20 > There are only a handful of places in kernel code that use > _Static_assert() directly. Nearly 900 instances of static_assert(). How many of those supply an error message? > Are we now saying it's fine to use _Static_assert() directly all over > the place? People will copy-paste and cargo cult. Is that actually a problem? The wrapper allows the error message to be omitted and substitutes the text of the conditional. But it isn't 'free'. As well as slightly slowing down the compilation, the error messages from the compiler get more difficult to interpret. Most of the static_assert() will probably never generate an error. But the ones in min()/max() will so it is best to make them as readable as possible. (Don't even look as the mess clang makes....) =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)