Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4393452ybb; Tue, 14 Apr 2020 06:30:04 -0700 (PDT) X-Google-Smtp-Source: APiQypIFfh8+H1XUTTT4ab923+lRGuDJsbpuAZRU+aje6Rk5MC9ocUHCAPjFRxT0q/8zOcsElOnC X-Received: by 2002:a17:906:5c43:: with SMTP id c3mr87574ejr.3.1586871004093; Tue, 14 Apr 2020 06:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586871004; cv=none; d=google.com; s=arc-20160816; b=nuUkNNZKMuohS9FlHwnFPt3qAL4IQxEckQAas2g69UkcE52C1yFx8yWYCh8Ls+2A+F 2leB2qDaT6N82hEFXUPXltGwXGxTjEjrDTUDD+W+uYMplDDCQHaSjxLERUsFIbfke0RT 1uw3/lv25WQmBEQOwgBX5EViiFvYS3Qh5cjouEjP7VtKja+4GsMe+Cx8noridrEGi+aQ t7AN7ShDO1y5Fb0FwTOZvlkp2VLGkysUZ6YyRVYvSX4pq7a+NoT+mO+j7uMVeR/Ifgw+ n4Kn9bvKZGygc0RNKQqaXiQhRYg2qw+z8lTL3i9dvVQkvdS/9C6Fm7+fdvCvSIsCelC6 KhVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=okqkFQ9Y/XR2Uylj/PBU9rQT9Y97Xsyzid6BJbXKYDw=; b=dBsbPIjmtXzF69gOBBQ/s+7X0z2YgYcT6ivVeJjEMf9NnrdgSZsp+tkn7QyE367bih 3DAcpFqWBdNiD3TDKaMJNcCcCABUqjTYuQRj9GuYtVLkBfIZMi65NlH27uSBR4CYfdRz qjhvoTOgfPi3I+pxMFhokDt6yW93Grr/CNLCWrRnl3bmX8bIWYOxRM7FwSf3hr6Ay3kQ uATTLAMhiUjKSt/dUUAnOiO/6B0PGSwPvkDpv77ellrGUkdDUUYqAzZ1fHQkKTB9uk6Z 7zRtCSiB5U35HQ+YQJRi2/0YXpuCtnh0iL9syzeQkoauKyUh8xRtagRWeW731lH06M/t vmWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KzdcNdOF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si5212443edy.281.2020.04.14.06.29.40; Tue, 14 Apr 2020 06:30:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KzdcNdOF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732992AbgDMS3P (ORCPT + 99 others); Mon, 13 Apr 2020 14:29:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727904AbgDMS3O (ORCPT ); Mon, 13 Apr 2020 14:29:14 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B760C0A3BDC for ; Mon, 13 Apr 2020 11:29:13 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id r14so4863762pfl.12 for ; Mon, 13 Apr 2020 11:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=okqkFQ9Y/XR2Uylj/PBU9rQT9Y97Xsyzid6BJbXKYDw=; b=KzdcNdOFkQ4motYzQSbGGZfva4sm/AvLEBRZ8iVoHUscDTl2KSZZLZF38aM21c80eF 2M+VUMpt5cmZayLcn5RmWrIO1Q5VeY+inACc6T245VKjcekv+5pcZkKD1dlxl79ki4P3 KucTeTdL6EsEZGiRjXw3Uqr6TSgHGjHmZe2vXVnHPTOQYjPON50cT9frLsN2S7lYmfn7 RxXQJqrvGGR4m2CzunPl5iiJoU72wbIil7j6aiNi6zQf3ofEOd8RKklFYpX604zp6lTi Y6OGtTn8lFuhozNA+rRtLEk4CbGC+43aBvo/QcBPiijapOM5KxkVCbqLp70ZTEfNkL/c ueNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=okqkFQ9Y/XR2Uylj/PBU9rQT9Y97Xsyzid6BJbXKYDw=; b=uAVgfw6AUX2yYGtHYqu6IULvFJzNy4krELT90dJcKAzS75u4TpBl63UNq0S/QxstbK tgORGfhLTb2QHoFCihoLQunjlT65kABPg0t7caQVKyNBlzNGvu8YAqjQDmtzZv4VxULb ROx8LcyV85XhkMGARiWoeGXaiziX00ELyhr6HAijIJlp9vC+0PkM0mY3oI0QhgFSHuaK TsQo1ywaRX7cb4fXsnnlO6348gWdl8fvQLg05/2IBXH4iy4y1JKPVIbFW8H7RypBoGpZ mi6madqXPyFSWrJzi2/DJPdgL5jUE7q3ZnZCTdmt/2SOEAy62GSUbQuaqpAAUSkLQiQF 28CA== X-Gm-Message-State: AGi0PuY5ZU4XTX+oDPAxPUrzWWeReGmZjUr74ZJQAy5jq5UZlNUpW16G JWx2K9GfLuZkVzYTGEHPK7EhnW/rHDHJuoHCDQqUmg== X-Received: by 2002:aa7:919a:: with SMTP id x26mr18865698pfa.39.1586802552376; Mon, 13 Apr 2020 11:29:12 -0700 (PDT) MIME-Version: 1.0 References: <20200407190558.196865-1-caij2003@gmail.com> In-Reply-To: <20200407190558.196865-1-caij2003@gmail.com> From: Nick Desaulniers Date: Mon, 13 Apr 2020 11:29:00 -0700 Message-ID: Subject: Re: [PATCH] ARM: replace the sole use of a symbol with its definition To: Jian Cai Cc: Manoj Gupta , Stefan Agner , Russell King , Enrico Weigelt , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner , Linux ARM , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 7, 2020 at 12:09 PM Jian Cai wrote: > > ALT_UP_B macro sets symbol up_b_offset via .equ to an expression > involving another symbol. The macro gets expanded twice when > arch/arm/kernel/sleep.S is assembled, creating a scenario where > up_b_offset is set to another expression involving symbols while its > current value is based on symbols. LLVM integrated assembler does not > allow such cases, and based on the documentation of binutils, "Values > that are based on expressions involving other symbols are allowed, but > some targets may restrict this to only being done once per assembly", so > it may be better to avoid such cases as it is not clearly stated which > targets should support or disallow them. The fix in this case is simple, > as up_b_offset has only one use, so we can replace the use with the > definition and get rid of up_b_offset. > > Signed-off-by: Jian Cai Probably didn't need the extra parens, but it's fine (unless another reviewer would like a v2). Maybe Stefan has some thoughts? Reviewed-by: Nick Desaulniers Please add Link tags if these correspond to issues in our link tracker, they help us track when and where patches land. Link: https://github.com/ClangBuiltLinux/linux/issues/920 > --- > arch/arm/include/asm/assembler.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h > index 99929122dad7..adee13126c62 100644 > --- a/arch/arm/include/asm/assembler.h > +++ b/arch/arm/include/asm/assembler.h > @@ -269,10 +269,9 @@ > .endif ;\ > .popsection > #define ALT_UP_B(label) \ > - .equ up_b_offset, label - 9998b ;\ > .pushsection ".alt.smp.init", "a" ;\ > .long 9998b ;\ > - W(b) . + up_b_offset ;\ > + W(b) . + (label - 9998b) ;\ > .popsection > #else > #define ALT_SMP(instr...) > -- > 2.26.0.292.g33ef6b2f38-goog > -- Thanks, ~Nick Desaulniers