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 X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CF4AC433ED for ; Fri, 30 Apr 2021 11:51:26 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2913E613E8 for ; Fri, 30 Apr 2021 11:51:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2913E613E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dRkdc2ppugskc1DLl2igxqUXwe/AtgCG16eeHsEuQf8=; b=IO+exr1Jg84ylQ8xEhA8h6Q+J gDj1SyaFBY4v5JjO/F3kud3PY4R0gKAx5iEA6zkuaNjKyIT4kGX1XdmUC/eZ//5ZYW4llnP4e4hRY VEQvejuqZgEOg5mQtIErjUPcVnEhcsx4cKSf4koARLI5w8A3KEL9C8A8QDvrXkUG1PaZAH4BtZuO+ 4TibSzXhwK2MmyYIgDmkOmNUeYKSDT+/cgF055I51jIMFjBBpCca9a+aY8J0Kne3YZyj31SksauaU 4feQE3NMxKu+0lTNHgOg64lKB0HKXlTmzI4hoPAgmUzATWusCVPv8pMnxQqbd8I8uxu7LXfc/15/B Mbo6nDiaw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lcReZ-007knM-29; Fri, 30 Apr 2021 11:49:51 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lcReW-007kml-Aq for linux-arm-kernel@desiato.infradead.org; Fri, 30 Apr 2021 11:49:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SPmBGskp9t90AjYD+jvckBjaJiRBTSyDdfAYjw+lXok=; b=ImTRjHBWTyBXul9Mcdz6p6OA52 nQ9G2Tvp/eBp0hXCXmI7g+W9/fGZ/Bg00SMcOVx4fYDsY2TfibUONWzIdlXYaZL4dLSebBxJeG+RY nPh3+vX+0fV5eRVwC3bVGcz612q1OHsX0Xc1kKRqyKKpB1wv+8r1fk4RoPNzxtmNC9C3NagWwKsS9 iEep0uclZoX9rl6YWUpc3FmFCDOfxQ/aXwuM2RVpklctXH2RfV7/HAPXn3DqAp8FPnKPIFYdkSGEh vzbdFsdYbaKbC50yTGzBpUP11eYQg+LGPfgOy15zotHdXl+eEZXZ6zrlbTXPCAzdh11cyXN/OMaxQ iU0kgtqA==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lcReT-001LD4-JQ for linux-arm-kernel@lists.infradead.org; Fri, 30 Apr 2021 11:49:47 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 16D87ED1; Fri, 30 Apr 2021 04:49:40 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.5.252]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1D1233F70D; Fri, 30 Apr 2021 04:49:37 -0700 (PDT) Date: Fri, 30 Apr 2021 12:49:35 +0100 From: Mark Rutland To: Julia Lawall Cc: Catalin Marinas , Will Deacon , Suzuki K Poulose , Anshuman Khandual , Marc Zyngier , Amit Daniel Kachhap , Denis Efremov , kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: cpufeatures: use min and max Message-ID: <20210430114935.GB53304@C02TD0UTHF1T.local> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210430_044945_706591_4DAD2F65 X-CRM114-Status: GOOD ( 14.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 29, 2021 at 10:50:46PM +0200, Julia Lawall wrote: > From: kernel test robot > > Use min and max to make the effect more clear. > > Generated by: scripts/coccinelle/misc/minmax.cocci > > Fixes: 8636e3295ce3 ("coccinelle: misc: add minmax script") > CC: Denis Efremov > Reported-by: kernel test robot > Signed-off-by: kernel test robot > Signed-off-by: Julia Lawall This looks like a nice cleanup, but it's not clear to me what the intended inclusion path for this is, and to avoid fragility I think we must include explicitly. With that: Acked-by: Mark Rutland Thanks, Mark. > --- > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12 > head: 44e793b89bcfe586730f4c6ce3c66174dc07cb37 > commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/5] coccinelle: misc: add minmax script > :::::: branch date: 6 days ago > :::::: commit date: 6 weeks ago > > cpufeature.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -695,14 +695,14 @@ static s64 arm64_ftr_safe_value(const st > ret = ftrp->safe_val; > break; > case FTR_LOWER_SAFE: > - ret = new < cur ? new : cur; > + ret = min(new, cur); > break; > case FTR_HIGHER_OR_ZERO_SAFE: > if (!cur || !new) > break; > fallthrough; > case FTR_HIGHER_SAFE: > - ret = new > cur ? new : cur; > + ret = max(new, cur); > break; > default: > BUG(); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1158829822121777603==" MIME-Version: 1.0 From: Mark Rutland To: kbuild-all@lists.01.org Subject: Re: [PATCH] arm64: cpufeatures: use min and max Date: Fri, 30 Apr 2021 12:49:35 +0100 Message-ID: <20210430114935.GB53304@C02TD0UTHF1T.local> In-Reply-To: List-Id: --===============1158829822121777603== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Thu, Apr 29, 2021 at 10:50:46PM +0200, Julia Lawall wrote: > From: kernel test robot > = > Use min and max to make the effect more clear. > = > Generated by: scripts/coccinelle/misc/minmax.cocci > = > Fixes: 8636e3295ce3 ("coccinelle: misc: add minmax script") > CC: Denis Efremov > Reported-by: kernel test robot > Signed-off-by: kernel test robot > Signed-off-by: Julia Lawall This looks like a nice cleanup, but it's not clear to me what the intended inclusion path for this is, and to avoid fragility I think we must include explicitly. With that: Acked-by: Mark Rutland Thanks, Mark. > --- > = > tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git= for-5.12 > head: 44e793b89bcfe586730f4c6ce3c66174dc07cb37 > commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/5] coccinelle: misc: = add minmax script > :::::: branch date: 6 days ago > :::::: commit date: 6 weeks ago > = > cpufeature.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > = > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -695,14 +695,14 @@ static s64 arm64_ftr_safe_value(const st > ret =3D ftrp->safe_val; > break; > case FTR_LOWER_SAFE: > - ret =3D new < cur ? new : cur; > + ret =3D min(new, cur); > break; > case FTR_HIGHER_OR_ZERO_SAFE: > if (!cur || !new) > break; > fallthrough; > case FTR_HIGHER_SAFE: > - ret =3D new > cur ? new : cur; > + ret =3D max(new, cur); > break; > default: > BUG(); --===============1158829822121777603==--