Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp896093rbb; Sun, 25 Feb 2024 08:49:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUoxL9GpttbEuSrqTiG3FA4NDj6yTaJmcCmPOn4Svc+6427cix8LaxlnHsYkE6fv9pTskwn5AFuqK72prqM1qW7C7a/yser84whqoDM1g== X-Google-Smtp-Source: AGHT+IHMQUnXeLglwOi06DCAG5dRPe18mztGmOT2v9Ki3LFsZ3wM2vxWbEXvaLoac5CexgIkbNqS X-Received: by 2002:ac2:4e05:0:b0:512:fded:e674 with SMTP id e5-20020ac24e05000000b00512fdede674mr360243lfr.61.1708879769954; Sun, 25 Feb 2024 08:49:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708879769; cv=pass; d=google.com; s=arc-20160816; b=KUcX5pgghmrvy6RQyIjnXg52LeNjwrezbo56Mcia6E+l4T6adMPIxD2CVAb6fHK3AT txbqEXZQ/l9Sx/YDu6yb9XCIEBKk9cJToSXkN7bv6BN5xOO2T9JHPLlLBwK8oOGHfokv BPFnzEE9cD8Htzz3df1shV+Dn3ws0wEE95NdHBB+MUOz7ToRTGZlV9+rnD/pBIzdB0Jd RBx8dIG1Sci3gRZ5bx7tKMj+Ktdm2Ntzs7Hy1PaJ1njoz1+cKUOqI//K78TKs0Nnzyb4 iR/P/k3iJaPLgD93hRGqNbR1Vw0DCiAAx8WN87SVfEtuZY0kEf8GlZcjsYPPJctLvGJP 2PtQ== 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=C3LKmkJkN8dkZ0RHNjijjC6uoAGGE0xrQwkKifLFDjY=; fh=nGE692sbVdRvha6RYbzMUXtm1nr/30sV7frdtDN2z14=; b=W9OZoznk4+vsB/oXbrBL02QFc26saYcso9kmtn7l6t4jpfGjfcpZDB1dCHjSM+yKHX pwuKsoGI2Jg8n8xsBUBpjge7h2QyT1hQx4XfRvoCjD1Om3EkB5BaH4JHNtZ1i8erkxsU StzdaZ6wi16LWhyaui4NbqCmswfiF22B1VODnEQ2mwYklafBHHQMiul3EJl5jelyobD0 ovUGpFEUvsgNmI8LTFUxJapDC5rnxRUOULZhRp+/vosOzlCWLLvOv8898v11Jg+tAm4F dJxKHSFSbnK3W2NSLcok817ZFTFKaKp/k0HziOhWjc4BQ1mq66UqHWp3gcVICbm1X288 JuHw==; 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-80210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80210-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k13-20020a05640212cd00b0056484c0df71si1283026edx.542.2024.02.25.08.49.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:49:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-80210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80210-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 958D01F21C25 for ; Sun, 25 Feb 2024 16:49:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 363FE182A7; Sun, 25 Feb 2024 16:49:17 +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 E6F1817BB4 for ; Sun, 25 Feb 2024 16:49:14 +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=1708879756; cv=none; b=YhFVnCO1KG4SfpOkaFiyXo6SbWf7/McgetMCsy/LeF/fE3HrNDCCJeLwWJgipYzDSo9qqH9hQGPkEkZpdIZVGuRdImKUM9G9VZAkeht6QAvmcxTqvK8W9pIWKeGxKQK5gc7GbrXYqAxxe0mTlYnHOOgzOcdvRh4wXOwcB8zPbtA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708879756; c=relaxed/simple; bh=8ye8TjxJr7Qpfxmc8F8Nww5LIwfQZHhRr6Lbkiz0KUc=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=FD3/YCHf1VYBsHaK3/U/wD9/GlO1iT9k3yxql8h62cl0T5XwggnJOPTFu4/hm7Q198NSEkfk2O1MYUh4SNum1ElmcL3PBb04GBwwboCXO4iZEmNIM1PBj84oyXAbJ1OFJnhWWiIoWqO2MARt07kxFIi2FM3mSxXzlQ0OpJWTZNs= 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-198-BfGlJeiVOxaAMdciN2scyQ-1; Sun, 25 Feb 2024 16:49:11 +0000 X-MC-Unique: BfGlJeiVOxaAMdciN2scyQ-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; Sun, 25 Feb 2024 16:49:10 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sun, 25 Feb 2024 16:49:10 +0000 From: David Laight To: "'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' , "'Jani Nikula'" Subject: [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: AdpoComWnYboZopTTWeIFfAWCv2rOw== Date: Sun, 25 Feb 2024 16:49:10 +0000 Message-ID: <8059bc04da1a45bc810ac339a1129a4c@AcuMS.aculab.com> References: <0fff52305e584036a777f440b5f474da@AcuMS.aculab.com> In-Reply-To: <0fff52305e584036a777f440b5f474da@AcuMS.aculab.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 The wrapper just adds two more lines of error output when the test fails. Signed-off-by: David Laight --- include/linux/minmax.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Changes for v2: - Typographical and spelling corrections to the commit messages. Patches unchanged. diff --git a/include/linux/minmax.h b/include/linux/minmax.h index 63c45865b48a..900eec7a28e5 100644 --- a/include/linux/minmax.h +++ b/include/linux/minmax.h @@ -48,7 +48,7 @@ #define __cmp_once(op, x, y, unique_x, unique_y) ({=09\ =09typeof(x) unique_x =3D (x);=09=09=09\ =09typeof(y) unique_y =3D (y);=09=09=09\ -=09static_assert(__types_ok(x, y),=09=09=09\ +=09_Static_assert(__types_ok(x, y),=09=09=09\ =09=09#op "(" #x ", " #y ") signedness error, fix types or consider u" #op= "() before " #op "_t()"); \ =09__cmp(op, unique_x, unique_y); }) =20 @@ -137,11 +137,11 @@ =09typeof(val) unique_val =3D (val);=09=09=09=09=09=09\ =09typeof(lo) unique_lo =3D (lo);=09=09=09=09=09=09\ =09typeof(hi) unique_hi =3D (hi);=09=09=09=09=09=09\ -=09static_assert(__builtin_choose_expr(__is_constexpr((lo) > (hi)),=09\ +=09_Static_assert(__builtin_choose_expr(__is_constexpr((lo) > (hi)),=09\ =09=09=09(lo) <=3D (hi), true),=09=09=09=09=09\ =09=09"clamp() low limit " #lo " greater than high limit " #hi);=09\ -=09static_assert(__types_ok(val, lo), "clamp() 'lo' signedness error");=09= \ -=09static_assert(__types_ok(val, hi), "clamp() 'hi' signedness error");=09= \ +=09_Static_assert(__types_ok(val, lo), "clamp() 'lo' signedness error");= =09\ +=09_Static_assert(__types_ok(val, hi), "clamp() 'hi' signedness error");= =09\ =09__clamp(unique_val, unique_lo, unique_hi); }) =20 #define __careful_clamp(val, lo, hi) ({=09=09=09=09=09\ --=20 2.17.1 - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)