Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp735748rdh; Wed, 23 Aug 2023 13:19:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHW0ASdO31P/AatfrNz795+jFcG3PfTwUUNpHpSFETfW3aWVbv5p9rO5FNU6rmx6D29w5On X-Received: by 2002:a05:6512:1594:b0:500:9b26:9760 with SMTP id bp20-20020a056512159400b005009b269760mr1351226lfb.13.1692821947691; Wed, 23 Aug 2023 13:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692821947; cv=none; d=google.com; s=arc-20160816; b=TUY6WEcOlFIs1bQLr7XKq4jVhXKSBQHw3bfogMHZvzwHuYVjPd17SRxvQ1RapL1Z4Q MR4lrbV7WbTx9esQI75eVo/YQs7/RVjM0dsJt4+7BBUcuwOKU95yyoPmObZJ2y5U8hBz YQkhWpv/U7inZu7MQCPiXuctwxbQkPEWDu66uZSCpReqVYXjjkM55B+1Du/lDzTHpGIz n0PoCTIhqBwWFjjV4Ea1Zi+3mtxaX6LG/lTwBhQlJKc4QvZHAM89M3+pg+N+8RUR63qI udKcYXcwOo7XSpjHaBqIsbBSgeX2WlGJRx0aHkSR7QQ2NI3cKixpy3/mCJlzsR1UbQHI mn+Q== 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:cc:to:from; bh=wRTOWoX65olbBseMJRAfXAC2GwzHEYfuVELx5AOP8eQ=; fh=CjcoCZ27AamWLGNb6zBWXqE1Qhn13YUPXgWmokLRY/s=; b=FxoyHH9KZ6K7OhPoZEupEd9PDY7IvBbXfAA0b8qceJN7lyA9WCfH5mwSe/ntpUBRYt bZhTA1vwINRgV5slgr1VZZGzAADScQCqH+PQ+wZbcp2nt53HErqCHLxlcAq8GOxMR0Fl 4emOGUPlEwEeK2qCH9P1ULrZxhyxSpCt8IATcH6zqdrk21yXFTA4yfRt1650tCIgi8yT Th7dw0hzTK4u/yZMfpuiQxkMFZFVywuXj1Q4BCVCy6H1Mou9ixtPlnQuvYrGbTqI25BS g4Zjlqayo3lCPUJlTqn64kzCVkNoI4i3hnS8HuEHUOR9mOW8Atu6f/2nSGiFhCytGK+G APBw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v22-20020aa7d9d6000000b0052a0875ef70si6054996eds.438.2023.08.23.13.18.21; Wed, 23 Aug 2023 13:19:07 -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 S235032AbjHWI5Q (ORCPT + 99 others); Wed, 23 Aug 2023 04:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234889AbjHWIpx (ORCPT ); Wed, 23 Aug 2023 04:45:53 -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 347DB2D67 for ; Wed, 23 Aug 2023 01:42:28 -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-37-v457HwcMNuOKYUb9WwIYpA-1; Wed, 23 Aug 2023 09:42:26 +0100 X-MC-Unique: v457HwcMNuOKYUb9WwIYpA-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; Wed, 23 Aug 2023 09:42:24 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Wed, 23 Aug 2023 09:42:24 +0100 From: David Laight To: 'Linus Torvalds' , Kees Cook CC: "linux-kernel@vger.kernel.org" , "Andy Shevchenko" , Andrew Morton , "Matthew Wilcox (Oracle)" , Christoph Hellwig , "Jason A. Donenfeld" Subject: RE: [PATCH next v3 0/5] minmax: Relax type checks in min() and max(). Thread-Topic: [PATCH next v3 0/5] minmax: Relax type checks in min() and max(). Thread-Index: AdnGwQ6IGYkn0IjZSjuTaOSyeQI0UwIK8m4AABl1+KABcxoeCQAeWbMw Date: Wed, 23 Aug 2023 08:42:24 +0000 Message-ID: <10b50bca86004232b28edf0143ce87fc@AcuMS.aculab.com> References: <01e3e09005e9434b8f558a893a47c053@AcuMS.aculab.com> <202308141416.89AC5C2@keescook> <2dd09c4033644239a314247e635fa735@AcuMS.aculab.com> <202308211113.4F49E73109@keescook> 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 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 RnJvbTogTGludXMgVG9ydmFsZHMNCj4gU2VudDogVHVlc2RheSwgQXVndXN0IDIyLCAyMDIzIDY6 MzYgUE0NCj4gDQo+IE9uIE1vbiwgMjEgQXVnIDIwMjMgYXQgMTE6MjQsIEtlZXMgQ29vayA8a2Vl c2Nvb2tAY2hyb21pdW0ub3JnPiB3cm90ZToNCj4gPg0KPiA+IEl0IHNlZW1zIGxpa2UgdGhlIGZv b3QtZ3VuIHByb2JsZW1zIGFyZSB3aGVuIGEgdmFsdWUgZ2V0cyBjbGFtcGVkIGJ5IHRoZQ0KPiA+ IGltcG9zZWQgdHlwZS4gQ2FuJ3Qgd2UganVzdCB3YXJuIGFib3V0IHRob3NlIGNhc2VzPw0KPiAN Cj4gSSB0aGluayB0aGF0IHRoZSBwcm9ibGVtIHdpdGggbWluX3QoKSBpcyB0aGF0IGl0IGlzIHVz ZWQgYXMgYSByYW5kb20NCj4gIndoZW4gbWluKCkgd2FybnMgYWJvdXQgZGlmZmVyZW50IHR5cGVz IiwgYW5kIHRoYXQgaXQgYmFzaWNhbGx5IGp1c3QNCj4gYWRkcyBhIGNhc3Qgd2l0aG91dCBhbnkg c2VtYW50aWMgbWVhbmluZy4NCj4gDQo+IEVuZCByZXN1bHQ6IHdlIGN1cnJlbnRseSBoYXZlIDQ1 MDArIG9mIHRob3NlIGNhc2VzIChhbmQgYW5vdGhlciAxMzAwDQo+IHVzZXMgb2YgJ21heF90Jykg YW5kIEkgYmV0IHRoYXQgc2V2ZXJhbCBvZiB0aGVtIGFyZSB0aGUgbmFycm93aW5nDQo+IGtpbmQu IEFuZCBzb21lIGFyZSBwcm9iYWJseSB2YWxpZC4NCj4gDQo+IEFuZCBpZiB3ZSB0aWdodGVuIHVw ICJtaW5fdCgpIiB0eXBlIHJ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