From patchwork Fri Jul 28 14:52:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Laight X-Patchwork-Id: 127720 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp527696vqg; Fri, 28 Jul 2023 08:53:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlFBwPzjqiAFLQoYTS6SuaCVIZKuPT+MX203001g1hRKwWg0c4cXLUSgAB45botjme75tQrs X-Received: by 2002:a17:902:ce86:b0:1bb:c64f:9a5e with SMTP id f6-20020a170902ce8600b001bbc64f9a5emr1699447plg.5.1690559628129; Fri, 28 Jul 2023 08:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690559628; cv=none; d=google.com; s=arc-20160816; b=xdOTJT9XSmgcxAIalwr/U0dtarkWBVvtPs78exnfMi5wZwjDiIjlvCwOuDKa3zO0Ll j0vyQw/WV28EUFiZ1elAcRrpHurGa5JVoA40qwcrggb6mOkJ+ShxTaRyA4o+JUzsXCpI V6FDsjgpRochivDWD8dMP0Nhe1vb0gkveuKzTOAplS3cIyBgaCdRr1AmYDL/dq2s2aIZ y0xRqutvi5RUJo9clBAAO8QEXB2WRUcidEq0Z3B84kMBRsHAaqABs5WOlvxGaJwlxBsa hEMXqZk985tMaafzlCTxVYj7+TI+NnDB/yhoAZEZMVXODGSPyoWlzM2/AC8l6LL6YKIH mmxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:to:from; bh=dJWhDJ2HXwm/mwDlbEP1u47zo6q3T8jkIFXdhx9BwDM=; fh=lQu0FQMQB/KijsOLYPBSZ4oPXp6gJVSgtvs90PKCM00=; b=pbuAS+cCRbxlhfNvIu5XDKY6TnenVzIJ4i8XdtvjxiuUPLi3dK9it7yS15PR3lJjFd ipeb2d8qjg3H/7JXzux8SPoA29HBlevJDqIh6qXslyNl1rMUQsS0tJE/cuZ9Iy8/VpeF hrmNI0ftLCf4rOaZln1WLARjmvDdoIy2nWXU/PnKvcyIdS9tQHeFoCAEmxUcd1BCcRsl ogHubZgFG9dkiDLrtIPcofsaiz+xNP8REk79ZRjHyYjVHsqSdSWgVLIFkYmUzArR+E12 uqpGRfmtTOzrJOni898Pe821fFw4S1ZL/sScoRG68f9P8xh0OLIzlIjZkAjjRFKKbUC5 ne4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a17090322c800b001bb053dc947si1119448plg.177.2023.07.28.08.53.34; Fri, 28 Jul 2023 08:53:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237224AbjG1OwQ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 28 Jul 2023 10:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjG1OwP (ORCPT ); Fri, 28 Jul 2023 10:52:15 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8BB512D for ; Fri, 28 Jul 2023 07:52:13 -0700 (PDT) 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-mtapsc-5-sywuu3JVNz6HXcqb2Y-XWg-1; Fri, 28 Jul 2023 15:52:11 +0100 X-MC-Unique: sywuu3JVNz6HXcqb2Y-XWg-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 28 Jul 2023 15:52:09 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 28 Jul 2023 15:52:09 +0100 From: David Laight To: "'linux-kernel@vger.kernel.org'" , "'Andy Shevchenko'" , 'Andrew Morton' , "'Matthew Wilcox (Oracle)'" , 'Christoph Hellwig' , "'Jason A. Donenfeld'" Subject: [PATCH next v2 3/5] minmax: Fix indentation of __cmp_once() and __clamp_once() Thread-Topic: [PATCH next v2 3/5] minmax: Fix indentation of __cmp_once() and __clamp_once() Thread-Index: AdnBYxCd11s+7olXQUGpHrOs4RAl0w== Date: Fri, 28 Jul 2023 14:52:09 +0000 Message-ID: <897033692e56449fbed8126484f2497e@AcuMS.aculab.com> References: In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772680252423270785 X-GMAIL-MSGID: 1772680252423270785 Remove the extra indentation and align continuation markers. Signed-off-by: David Laight --- v2: No change include/linux/minmax.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/linux/minmax.h b/include/linux/minmax.h index cb126853f2be..4c77ac9ed284 100644 --- a/include/linux/minmax.h +++ b/include/linux/minmax.h @@ -28,11 +28,11 @@ #define __cmp(op, x, y) ((x) __cmp_op_##op (y) ? (x) : (y)) #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), \ - #op "(" #x ", " #y ") signedness error, fix types or consider " #op "_unsigned() before " #op "_t()"); \ - __cmp(op, unique_x, unique_y); }) + typeof(x) unique_x = (x); \ + typeof(y) unique_y = (y); \ + static_assert(__types_ok(x, y), \ + #op "(" #x ", " #y ") signedness error, fix types or consider " #op "_unsigned() before " #op "_t()"); \ + __cmp(op, unique_x, unique_y); }) #define __careful_cmp(op, x, y) \ __builtin_choose_expr(__is_constexpr((x) - (y)), \ @@ -42,16 +42,16 @@ #define __clamp(val, lo, hi) \ ((val) >= (hi) ? (hi) : ((val) <= (lo) ? (lo) : (val))) -#define __clamp_once(val, lo, hi, unique_val, unique_lo, unique_hi) ({ \ - typeof(val) unique_val = (val); \ - typeof(lo) unique_lo = (lo); \ - typeof(hi) unique_hi = (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"); \ - __clamp(unique_val, unique_lo, unique_hi); }) +#define __clamp_once(val, lo, hi, unique_val, unique_lo, unique_hi) ({ \ + typeof(val) unique_val = (val); \ + typeof(lo) unique_lo = (lo); \ + typeof(hi) unique_hi = (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"); \ + __clamp(unique_val, unique_lo, unique_hi); }) #define __careful_clamp(val, lo, hi) ({ \ __builtin_choose_expr(__is_constexpr((val) - (lo) + (hi)), \