From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60AE2C001B0 for ; Wed, 26 Jul 2023 10:25:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D87986B0071; Wed, 26 Jul 2023 06:25:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D36AB6B0074; Wed, 26 Jul 2023 06:25:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD78F6B0075; Wed, 26 Jul 2023 06:25:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id AB4046B0071 for ; Wed, 26 Jul 2023 06:25:19 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 761021A018A for ; Wed, 26 Jul 2023 10:25:19 +0000 (UTC) X-FDA: 81053380758.12.BBFA308 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by imf15.hostedemail.com (Postfix) with ESMTP id 17554A0012 for ; Wed, 26 Jul 2023 10:25:16 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=aculab.com; spf=pass (imf15.hostedemail.com: domain of david.laight@aculab.com designates 185.58.86.151 as permitted sender) smtp.mailfrom=david.laight@aculab.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690367117; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1rZs+xIdugv2kTDgRH43s+OwXUgv0vGAtG3WWh1OR8E=; b=x1Q8z2E/qdYxFRdq0svTBgyW9NieDO77eR89uiHs6xxELTYDz9MB30a9fW9zx3z/uUtRBm FglJvABUlVyHla+L+0Jnf9J1bZlh+uh7mrp6OK4RLKCXvfqpRLTnQaS2sdysq/luYTrcxz DcdXPznVNtIg5JYpWa1TzFdqfZNXnRM= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=aculab.com; spf=pass (imf15.hostedemail.com: domain of david.laight@aculab.com designates 185.58.86.151 as permitted sender) smtp.mailfrom=david.laight@aculab.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690367117; a=rsa-sha256; cv=none; b=AcecYj6dCXnsqkX6zzY622mxGYPGjN5STFeHVSIlhMEi9Ugv8SFhyfSvPjeMB5H3Uf26p3 2JvDGnfvHUFMHzA6TNlP+C9B22P/+5bnP4z+yWW4SGL4xPjJpSdxtOqwsNa2qlSnRU8dPj GD5slUrwxqr5X+unDuAKWjyEFjhoIpI= 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-239-fUxCrhtrNSu2GVWHIquJNA-1; Wed, 26 Jul 2023 11:25:13 +0100 X-MC-Unique: fUxCrhtrNSu2GVWHIquJNA-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; Wed, 26 Jul 2023 11:25:11 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Wed, 26 Jul 2023 11:25:11 +0100 From: David Laight To: 'Marc Zyngier' CC: 'kernel test robot' , "'linux-kernel@vger.kernel.org'" , 'Andy Shevchenko' , 'Andrew Morton' , "'Matthew Wilcox (Oracle)'" , 'Christoph Hellwig' , "'Jason A. Donenfeld'" , "llvm@lists.linux.dev" , "oe-kbuild-all@lists.linux.dev" , "Linux Memory Management List" , Rob Herring Subject: RE: [PATCH next resend 2/5] minmax: Allow min()/max()/clamp() if the arguments have the same signedness. Thread-Topic: [PATCH next resend 2/5] minmax: Allow min()/max()/clamp() if the arguments have the same signedness. Thread-Index: Adm+7j8pPhAgcq+TRICTXJcSfHQLRAAL9FKAACBy3mD///zQgP//50cA Date: Wed, 26 Jul 2023 10:25:11 +0000 Message-ID: <4d15014d6b4f434786d50bc4f2199f23@AcuMS.aculab.com> References: <202307260256.nzImScXA-lkp@intel.com> <6bed42e871e74e898b400a404ec6d142@AcuMS.aculab.com> <86ila7t30q.wl-maz@kernel.org> In-Reply-To: <86ila7t30q.wl-maz@kernel.org> 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: quoted-printable X-Rspam-User: X-Stat-Signature: piy1wuyn6degpx9jz4xfeiswhppeqabu X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 17554A0012 X-HE-Tag: 1690367116-411113 X-HE-Meta: U2FsdGVkX1/dtMDiaBOwB8OLXaeWEQGBkQxfEGxCzM7JmL6pYxKqTzUmIMc2tlLWTclyqnkOwZHNSrLOSnuz6YFMbYSCcTOkvICDQLcVoadcXa7MQgFWkHXtgZ5OAtcq+ygD55kIxnwWcRCPoMZJaw51ad4lNi+1KaoamhAKdlMCoUqXD/QvxleScKF3iRqyGrwWXZ7521PDAaoGHgEDvidp/StLCH5Xuy8+mB7lWb38Hu1wyNTEXXo8a4Sb9pSi37ad0n2A4QJDAFns7yGrAUHSq0YnDi6oZb61TOwbP0hLeVp2dLcDlGYnmUx6f+/tAMvQVkgsz9FBM1Os0BKYTfNA9r907YfAhm9PHJvIAYVG8qT/Fu7wFKLeKdZyl4BZzmiX92XUEVwmjUgz1660wCXWa6m0OtmCRqyAd3bWpZBA4vtxX/HOIrGQwv5oL0LA7X8Hcl8uZ+VeV19cB5UYMtUDhAHN059jUWznMZHNvscpzylvoToK3x1G6fQB/cB4OGt4ceSEiBWCiyGajbrnBm3T6e3C70f3gE3cZvNCocrUuZQwS3sA6byFnAcxrrsbZL/u/WbdWat7nxgbNffR6AIYZV2+MFBjSgZNdu9lSy3sVZCjamGpw5i9J8XfSQWvlCj1undbEIZMebnBgcIilyWkHVj4PQ9WfmspBZeGPdAgbm0WA5adNuZGAEh+qxLeUZxwBYxipQNjHQ9a/BZAwyIf2m5+YhD3osWtG9b7ZnmzVjbXRiKRafcmJY4h6yJoICcBBwn2r1n2cpmrHxeJAPmcNnWY/7AGy3iclkasGKe2n+Zvxxq2wsVEB6FoQKnxM+p4YonuFa0x2UXblefgCmncRe7ruF/D/NvpUG4M0fMGG52LDbLA1rW2PQukqGrg5xGIC5uCNFkKntdWTwexfcu/C38EBtTwey4Dudual5G7OsBxmVbLO4lSleX0SrTdj1G4/+V3ZA6W8C6/miW qhZlpFjj vB02Zv696kmk8rcvXeMqp6MDQz3C+znLS3iWyvnCqvOLY16F9XhaqK3t8nyw6TADk1CYk/zCFLDc6bnlAVPKMkPQ9hgQdYZJHx7Sx+MrgwH4WFExwf0+JAm8uUuOHDJd59TicBOSBkufNRTupWUJLpLodKTv1uMeY0vt6R8dlUADM2ktDz7CUS8jdV1dCgGdAUHja81EIl9c4EXkagJxLPAqjzi3oOSUwb6OsoSnjleAs1zuumK75z70xT8jWqaKbppW99myHeW1Z0fNcmOG23I1EqBALaT3H0XEwMlukUIcmWH04jjmsvTWfpLbacCuXDiSX X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Marc Zyngier > Sent: 26 July 2023 10:51 >=20 > On Wed, 26 Jul 2023 10:19:48 +0100, > David Laight wrote: > > > > > From: kernel test robot > > > Sent: 25 July 2023 19:33 > > ... > > > > > > All errors (new ones prefixed by >>): > > > > > > >> drivers/irqchip/irq-mips-cpu.c:288:1: error: call to undeclared fu= nction '__typecheck'; ISO C99 > and > > > later do not support implicit function declarations [-Wimplicit-funct= ion-declaration] > > > 288 | IRQCHIP_DECLARE(cpu_intc, "mti,cpu-interrupt-controller", = mips_cpu_irq_of_init); > > > | ^ > > > include/linux/irqchip.h:37:38: note: expanded from macro 'IRQCHIP_= DECLARE' > > > 37 | OF_DECLARE_2(irqchip, name, compat, typecheck_irq_= init_cb(fn)) > > > | ^ > > > include/linux/irqchip.h:24:3: note: expanded from macro 'typecheck= _irq_init_cb' > > > 24 | (__typecheck(typecheck_irq_init_cb, &fn) ? fn : fn= ) > > > | ^ > > > >> drivers/irqchip/irq-mips-cpu.c:288:1: error: initializer element i= s not a compile-time constant > > > 288 | IRQCHIP_DECLARE(cpu_intc, "mti,cpu-interrupt-controller", = mips_cpu_irq_of_init); > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~ > > > include/linux/irqchip.h:37:2: note: expanded from macro 'IRQCHIP_D= ECLARE' > > > 37 | OF_DECLARE_2(irqchip, name, compat, typecheck_irq_= init_cb(fn)) > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~ > > > include/linux/of.h:1493:3: note: expanded from macro 'OF_DECLARE_2= ' > > > 1493 | _OF_DECLARE(table, name, compat, fn, of_in= it_fn_2) > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~ > > > include/linux/of.h:1481:2: note: expanded from macro '_OF_DECLARE' > > > 1481 | _OF_DECLARE_STUB(table, name, compat, fn, fn_type) > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > include/linux/of.h:1470:16: note: expanded from macro '_OF_DECLARE= _STUB' > > > 1470 | .data =3D (fn =3D=3D (fn_type)NULL) ?= fn : fn } > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~ > > > > It looks like irqchip.h is using __typecheck() which is really > > an internal part of the implementation of min() and max(). > > The patched version doesn't use it - hence the build fail. > > I can re-instate it, but this all looks wrong to me. >=20 > Please see f1985002839a ("irqchip: Provide stronger type checking for > IRQCHIP_MATCH/IRQCHIP_DECLARE") for the rationale. >=20 > Given that this has uncovered a number of bugs, I'm not letting this > go without an equivalent replacement. .. >=20 > They are used in different contexts. See IRQCHIP_MATCH(). Ah, I was seeing the error in the expansion of IRQCHIP_DECLARE() which is doing the type check twice. It can just pass 'fn'. The cast NULL check does work. So IRQCHIP_MATCH() can use the simpler 'fn =3D (fn_type)NULL ? fn : fn' tes= t that _OF_DECLARE_STUB() uses. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)