Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2011194rwr; Fri, 28 Apr 2023 05:08:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6UxRdNzXSzvWFvybnWmwtTHteMPVXbtRTci/w+Yley7o5Dn4QViiq1EztNFJotwsxDSVX1 X-Received: by 2002:a17:902:d349:b0:1a9:2823:dad3 with SMTP id l9-20020a170902d34900b001a92823dad3mr5136993plk.42.1682683730219; Fri, 28 Apr 2023 05:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682683730; cv=none; d=google.com; s=arc-20160816; b=kHglZ+qT8OH1DTtGdY4i36bBTmmcLiZwtk72Q/O5jQxkOPumjnLzAtRuAxRATYQNRc g+bNw5JX9sA+hU6zosOCmtuPxmGuuwnE3sU4KzfzVIsprgwNm35/RD0Kx/27UpojE4/S jzZxaE1NJTghE4UHMT6qAvbMudkAB170zmaQ9wW/Nq1QEtWHBjkl1OZqJuhx+N05sfya Lp8NLfBaB6slkj3PtlKsn84WcbQQ2ANq2Yr1hfDyMF19Qhvy3+AM2YTyJ2PWkSb4pha1 UgCsvc9CVdo10EGOjQ/T7Q2z3b6PCSvF8FZsVdhkgISILCsrpMAnf9sZ2mscpkE/M0NN AAyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NJSTc314pcl3Sn08DaZqfTyINK9W9dmUbWFqYX+O//Q=; b=HEJYU5w128As98noc/ddw+1rTFIga+o/qbD8TqOF7cZA81lzmqXt6TZuk1U7zO4xJm EgEH4UBdy0a0FNWZOZK+7Bu0tmJiWwZY1PXnmPVNPkaNDrbF/wxeOtl2UpKAYLaoTf1l Xo+DyWWKEAs+CN6CRGwAKNhuZ+URrCLkMSvBPT18vJ5zVbsuw+ukPBqIQd5yFJMkIkFd AN0ftwPveeru9kq9Zl2PyRym8OJ56P612LER/US7uM8ceQZuFcw8Ox/eTot22pDGaEjc YXQSFCDM4vvRB3/H+PAQ1cTKaNl3RstPp7jSZqxc/a8Ls5rqY7dBoFkN0+vzj4lkVqs3 qVlA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a170902650600b001a654886149si20629391plk.96.2023.04.28.05.08.37; Fri, 28 Apr 2023 05:08:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239683AbjD1MIL (ORCPT + 99 others); Fri, 28 Apr 2023 08:08:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345965AbjD1MIJ (ORCPT ); Fri, 28 Apr 2023 08:08:09 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D2345B88; Fri, 28 Apr 2023 05:07:56 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1psMro-0007Uh-00; Fri, 28 Apr 2023 14:06:24 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id AEDC2C02E0; Fri, 28 Apr 2023 14:06:18 +0200 (CEST) Date: Fri, 28 Apr 2023 14:06:18 +0200 From: Thomas Bogendoerfer To: genjian zhang Cc: rdunlap@infradead.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Genjian Zhang , k2ci Subject: Re: [PATCH v2] fix ___SYNC () build error when PROFILE_ALL_BRANCHES is enabled Message-ID: <20230428120618.GA11325@alpha.franken.de> References: <20230427150332.2978867-1-zhanggenjian@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,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 On Fri, Apr 28, 2023 at 03:13:32PM +0800, genjian zhang wrote: > On Thu, Apr 27, 2023 at 11:05 PM Genjian wrote: > > > > From: Genjian Zhang > > > > compiler error (mips-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110): > > > > {standard input}: Assembler messages: > > {standard input}:171: Error: found '(', expected: ')' > > {standard input}:171: Error: found '(', expected: ')' > > {standard input}:171: Error: non-constant expression in ".if" statement > > {standard input}:171: Error: junk at end of line, first unrecognized > > character is `(' > > > > Expands ___SYNC() macros. However, 'if' statement will be wrong > > assembly.This Compilers report a lot of errors like the above. > > this problem is caused by the #define of if() in > > include/linux/compiler.h when CONFIG_PROFILE_ALL_BRANCHES > > is set. Move '.if' into quoted strings to fix it. > > > > Reported-by: k2ci > > Signed-off-by: Genjian Zhang > > --- > > arch/mips/include/asm/sync.h | 7 ++++--- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/arch/mips/include/asm/sync.h b/arch/mips/include/asm/sync.h > > index aabd097933fe..56a4f6f6cdef 100644 > > --- a/arch/mips/include/asm/sync.h > > +++ b/arch/mips/include/asm/sync.h > > @@ -175,7 +175,7 @@ > > */ > > #ifdef CONFIG_CPU_HAS_SYNC > > # define ____SYNC(_type, _reason, _else) \ > > - .if (( _type ) != -1) && ( _reason ); \ > > + ((_type) != -1) && (_reason); \ > > .set push; \ > > .set MIPS_ISA_LEVEL_RAW; \ > > .rept __SYNC_rpt(_type); \ > > @@ -192,13 +192,14 @@ > > /* > > * Preprocessor magic to expand macros used as arguments before we insert them > > * into assembly code. > > + * In addition,'if' cannot be enabled. > > */ > > #ifdef __ASSEMBLY__ > > # define ___SYNC(type, reason, else) \ > > - ____SYNC(type, reason, else) > > + .if ____SYNC(type, reason, else) > > #else > > # define ___SYNC(type, reason, else) \ > > - __stringify(____SYNC(type, reason, else)) > > + ".if" __stringify(____SYNC(type, reason, else)) > > #endif > > > > #define __SYNC(type, reason) \ > > -- > > 2.25.1 > > > > This patch does not take into account the situation that CPU_HAS_SYNC > is not set. I will revise it later. please post as a new mail not as a replay to this thread. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]