From patchwork Fri Aug 4 10:55:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Laight X-Patchwork-Id: 131110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:44a:b0:3f2:4152:657d with SMTP id ez10csp190276vqb; Fri, 4 Aug 2023 04:23:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQSZb+EytmiUUvttPmr/pv5oMEMXYQRd5CoAqxBl8ltrqziqwqd9+90rwqAifztEQxOrIu X-Received: by 2002:a17:90a:109:b0:268:10a3:cea8 with SMTP id b9-20020a17090a010900b0026810a3cea8mr1125680pjb.9.1691148225229; Fri, 04 Aug 2023 04:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691148225; cv=none; d=google.com; s=arc-20160816; b=p4sfnvB4nEWBUnwnIL04ZLioCwAAEThG/E5qelZ4iX0d8K9cuF9QcbSw2Veu9Q/jOg XIbnoUJTwrSqBDTVKq1/oG0JhuEtUueIANgVHw8yI8vllMzJ5EgJC/gqJUhVAhvm3tTp /nS3YdTn2faCqKajnXN5ypfV4RZVjbuqmevV65bs+G6yisFXanprRyWfunwJFUv84hzn ZS/E70lPzro3IJHz4aK7Y57x+c2sPzSYLsnwr33kR9qaETKYr+dWl3072uQPcwq1oZsz DR7Ewt9epHzCQd2DXmh+TAGwSq7M7cV3MgkFVuYtSFXz3yuwFFIdcXvi3glxGGQbvLN1 trog== 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=Y8c3WVJ6dUQRY1ZycsDDkSA5CpbmIL//l3CvpIkek9A=; fh=pN9u3RSY7mSaVAE5ETLbHLyNgii5TPzFbem5G9NhfYQ=; b=z0/hPjvw8mOIoFRDaCWjKe6cofbWhxGFtjn4W45NqlxM4y6ty5dMqTN1xv756DGNAg TVK7mQLJoErX3AAO/J/4NZHnUjBPQBH5x9YMhMhp22TjnJjNekoXUUt+MvuA6KlAvTVT dPR/WMlHtE7pV0CcLUneJEpG/gLII75dAiD30UcATDISgcj4LSSr94Uuv7tFblZICSTI apegdvKJs33K9CMGcPXVJ4QQ9xO8gx0AYys6mJnBgr5zeVA/iluYfEWJtaZciPkKaur3 jz86m+3RpIRZhWnTKnzaBd80PDndSTpZjb0Rcqvb8Iry8on1c7sA8vIkG75srbFjx/JE lSuQ== 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 i10-20020a17090ad34a00b00263e1d9c4f2si1770226pjx.26.2023.08.04.04.23.31; Fri, 04 Aug 2023 04:23:45 -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 S230082AbjHDK5T convert rfc822-to-8bit (ORCPT + 99 others); Fri, 4 Aug 2023 06:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjHDK4y (ORCPT ); Fri, 4 Aug 2023 06:56:54 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F134C0E for ; Fri, 4 Aug 2023 03:55:05 -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-mta-202-eiqKgpkyP26HhE95mGFrRA-1; Fri, 04 Aug 2023 11:55:03 +0100 X-MC-Unique: eiqKgpkyP26HhE95mGFrRA-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; Fri, 4 Aug 2023 11:55:01 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 4 Aug 2023 11:55:01 +0100 From: David Laight To: "'linux-kernel@vger.kernel.org'" , "'Andy Shevchenko'" , 'Andrew Morton' , "'Matthew Wilcox (Oracle)'" , 'Christoph Hellwig' , "'Jason A. Donenfeld'" , 'Linus Torvalds' Subject: [PATCH v3 3/5] minmax: Fix indentation of __cmp_once() and __clamp_once() Thread-Topic: [PATCH v3 3/5] minmax: Fix indentation of __cmp_once() and __clamp_once() Thread-Index: AdnGwhrPydTNzZQYQuOxSX4R9e8zzQ== Date: Fri, 4 Aug 2023 10:55:01 +0000 Message-ID: <6dc20ac7cb6f4570a0160f076e8362e3@AcuMS.aculab.com> References: <01e3e09005e9434b8f558a893a47c053@AcuMS.aculab.com> In-Reply-To: <01e3e09005e9434b8f558a893a47c053@AcuMS.aculab.com> 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_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS 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: 1773297441216124689 X-GMAIL-MSGID: 1773297441216124689 Remove the extra indentation and align continuation markers. Signed-off-by: David Laight --- v3: No change 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 6f79e44aad86..ccfbe003a643 100644 --- a/include/linux/minmax.h +++ b/include/linux/minmax.h @@ -33,11 +33,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)), \ @@ -47,16 +47,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)), \