Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp20739rdb; Sun, 28 Jan 2024 11:27:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJ6EmdXt0Gx6QnYJlLd6Iny8Ru5e7YzL2KS9FjOjXHK1wh7lIhjC4J0EjRzJRSjLGOdYuJ X-Received: by 2002:a05:6870:b415:b0:210:b21e:579 with SMTP id x21-20020a056870b41500b00210b21e0579mr3743734oap.35.1706470070747; Sun, 28 Jan 2024 11:27:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706470070; cv=pass; d=google.com; s=arc-20160816; b=kvWcJnKKL2jiu/M+FAWrL8DxMJT4CHVs9B4MJVjdidaljnh1pcKWYgARJtBIxd/27H kGV7WgXMSdsxfXsPesAzApIPrZTWTUf95m4xuCldQkj7Vf9je93ZCmCFlQ6tJIsRosQz xmff5bzUQiMYHy5tnLjbFoNAWcmZcwfBcAVYYNxmrTXuwUF7Yf7NtMsx7Ww4GHtbm3GR zEW+ciqSqD0qiWTohpVSFZb1A/NqsKQ1ETmfFIuZsZNTAau8vl495jf6WDbxst5/4dBV l4EdsecVNkc0fw2Y1ceCHhkf31a2ppnadqzO65eUS5JKQaoMJYbj+sp/979oxvh7zDk4 38LA== 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=4PlX85F8IQmYp6Gqt8heE31KxwL9l77v53lRBRlREpY=; fh=jAOu/RGlQxfhPk7PcGNzOfYLHKZO+STAaG1daOB/TAU=; b=pOTu3QH4hMhQkl7VzMOCHpDLcI0ZXmFTkka8FamlkSUB/fEuHrtdsE4ojZd2tyzpVG zw6fCqPwT/bsenzRj4AGYBcXtcx1ZrGxY3qglo++BuO78oEZ5xRd5jEQcceNoL4If4Sm Nz78FDrFA7JJUKYWF/V6Lf72+YpfiQvMlZ/xESwR4272mPvamsEl6FsOyRgI0eW/JQJx vLu8dI6zF2UCq49JwvsQEXJUmVNHSQxopmCD1zZvED9YvnqF5YQUEgitsBm7fCQKwpQX I9FmZfQPPJHtyHR+KxASDKjvn1B+bik9CSVV5ssWT/T2bFgBmS9vDeIWwcR4K82Qfaw3 lWKg== 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-41899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41899-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j192-20020a638bc9000000b005d66232593dsi4468480pge.868.2024.01.28.11.27.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 11:27:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-41899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41899-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 683A2B213DC for ; Sun, 28 Jan 2024 19:27:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B18513B7A0; Sun, 28 Jan 2024 19:27:31 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.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 274D031A66 for ; Sun, 28 Jan 2024 19:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.86.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706470051; cv=none; b=IT3A12aiGQYl3Ig8cfFE2oWgs0R7E1sNH5TFLCf5keX/nIEzsupUMyM/HQoEJJVMY/tiWRsFUQsLOE6qjzUjxEW8HBMh4lfUYPHTDXuUudzP1+TTDwPWC5Y3kx/pa1wBXKEiK9y7t0qWM3dW+a41Gza3gg4/Nls94nS4M3E6gM4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706470051; c=relaxed/simple; bh=4PlX85F8IQmYp6Gqt8heE31KxwL9l77v53lRBRlREpY=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=gvNbi1lUO4MS1+6+IY5zbf1vyAWKXu6zMJiF+A+tB1GCqzzDEJ9oR86bs0Sq0siEz5AECBXa0JnNzgdMwBQgYdOZTzi8jGu9O7obkPjMbuOFbN2P5+yvdPuhN0bxP4kypfsLrSbytAf//k7Rnc1X9fqk2k13rjCNr/Uin3PkgQE= 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.86.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-159-rCbWEvFaNbeFCgOxkdKWkw-1; Sun, 28 Jan 2024 19:27:25 +0000 X-MC-Unique: rCbWEvFaNbeFCgOxkdKWkw-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, 28 Jan 2024 19:27:01 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sun, 28 Jan 2024 19:27:01 +0000 From: David Laight To: "'linux-kernel@vger.kernel.org'" , "'Linus Torvalds'" , 'Netdev' , "'dri-devel@lists.freedesktop.org'" CC: 'Andy Shevchenko' , 'Andrew Morton' , "'Matthew Wilcox (Oracle)'" , 'Christoph Hellwig' , "'Dan Carpenter'" , 'Linus Walleij' , "'David S . Miller'" , "'linux-btrfs@vger.kernel.org'" , 'Jens Axboe' Subject: RE: [PATCH next 02/11] minmax: Use _Static_assert() instead of static_assert() Thread-Topic: [PATCH next 02/11] minmax: Use _Static_assert() instead of static_assert() Thread-Index: AdpSIAEy7Smj9oosQ+KB7MRH0ZnbRA== Date: Sun, 28 Jan 2024 19:27:01 +0000 Message-ID: References: <0ca26166dd2a4ff5a674b84704ff1517@AcuMS.aculab.com> In-Reply-To: <0ca26166dd2a4ff5a674b84704ff1517@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(-) 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)