From patchwork Sun Feb 25 16:49:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Laight X-Patchwork-Id: 13570958 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 DE8C817BB3 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: netdev@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 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) ({ \ typeof(x) unique_x = (x); \ typeof(y) unique_y = (y); \ - static_assert(__types_ok(x, y), \ + _Static_assert(__types_ok(x, y), \ #op "(" #x ", " #y ") signedness error, fix types or consider u" #op "() before " #op "_t()"); \ __cmp(op, unique_x, unique_y); }) @@ -137,11 +137,11 @@ typeof(val) unique_val = (val); \ typeof(lo) unique_lo = (lo); \ typeof(hi) unique_hi = (hi); \ - static_assert(__builtin_choose_expr(__is_constexpr((lo) > (hi)), \ + _Static_assert(__builtin_choose_expr(__is_constexpr((lo) > (hi)), \ (lo) <= (hi), true), \ "clamp() low limit " #lo " greater than high limit " #hi); \ - static_assert(__types_ok(val, lo), "clamp() 'lo' signedness error"); \ - static_assert(__types_ok(val, hi), "clamp() 'hi' signedness error"); \ + _Static_assert(__types_ok(val, lo), "clamp() 'lo' signedness error"); \ + _Static_assert(__types_ok(val, hi), "clamp() 'hi' signedness error"); \ __clamp(unique_val, unique_lo, unique_hi); }) #define __careful_clamp(val, lo, hi) ({ \