Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp156801pxf; Wed, 17 Mar 2021 01:44:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrGnUzlhk8Cv7MfNuDpAX47iO22fvnVFz5K5tTKD37I16v35w/1wB9Iu4Qy8JVtdcBqdd2 X-Received: by 2002:a50:ec0e:: with SMTP id g14mr40960471edr.264.1615970693930; Wed, 17 Mar 2021 01:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615970693; cv=none; d=google.com; s=arc-20160816; b=WuCKGpguEIOOlOmjeAwTpCT6jGRVGXEfCANsFYeeAaMUE5MpaNmDsq/a277jOXspt6 VLsce2U0yj6SwctrE49Xz1jCW0fqcE/7VxwReUbTqA4RO8vj78yPA7zmmV1pgVbGKj5L dnN1EuGx69D7eZw6IUrYTWwTtP/i+TIFORwen8qhhWq/yPEOPnGt5fwaE7Gt17SoT8Gg MV4xp96aRQDE2o7aVH2xN2vqBSp2rKtLHWbZUH7J4ZRa/WOAIBkqbdKBt6Wv2kShGxXW kpuVEg1VIQEqUW/uXk1sTMHXYVgw5hShFgKTid8GT/LT0hUBj4lOV+V/atQJniC9eVm1 0ajg== 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-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date; bh=EWpjOu3asiG8arcBj0SdosCwsxJg5rmej2wUlXjCaps=; b=TO5gKMiZ7fxuR9etmcAClsegenK9vIPlIAX3PAYQq+4mdLuiLTbWNQS1I3fyvVnJNg C8bLE2Noilmzsn5ztcYP+Xz4R4H6NsR3B/Hn4TuxSe13bESMwf+1hvfsoU7mQGoOybwL D1xI8fv2yNpA9Tg8YjYbNdZgvVmOjXFoQyrpSr1PrHh5Q/Cqsdt3OWy2h56BGgMtconk Gv6REb1s3VpGZDR+7BSmoGVh4+hfcjFDuEhK+zp8sfDikXiJE9WtyMls9flw4bFxxsHh AOwQwThfTE9ByHSSvH0r65qFg5QyEE5QG1Mq53DSaE0cuQ6QBq2egZOA/XnxxWJSRXiI apwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si10478536eda.196.2021.03.17.01.44.31; Wed, 17 Mar 2021 01:44:53 -0700 (PDT) Received-SPF: pass (google.com: 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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbhCQIli (ORCPT + 99 others); Wed, 17 Mar 2021 04:41:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:51742 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbhCQIlM (ORCPT ); Wed, 17 Mar 2021 04:41:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6EE85AB8C; Wed, 17 Mar 2021 08:41:11 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 78325DA6E2; Wed, 17 Mar 2021 09:39:09 +0100 (CET) Date: Wed, 17 Mar 2021 09:39:09 +0100 From: David Sterba To: Victor Erminpour Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] btrfs: Use immediate assignment when referencing cc-option Message-ID: <20210317083909.GM7604@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Victor Erminpour , clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <1615934770-395-1-git-send-email-victor.erminpour@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1615934770-395-1-git-send-email-victor.erminpour@oracle.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 03:46:10PM -0700, Victor Erminpour wrote: > Calling cc-option will use KBUILD_CFLAGS, which when lazy setting > subdir-ccflags-y produces the following build error: > > scripts/Makefile.lib:10: *** Recursive variable `KBUILD_CFLAGS' \ > references itself (eventually). Stop. > > Use := assignment to subdir-ccflags-y when referencing cc-option. > This causes make to also evaluate += immediately, cc-option > calls are done right away and we don't end up with KBUILD_CFLAGS > referencing itself. > > Signed-off-by: Victor Erminpour > --- > fs/btrfs/Makefile | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile > index b634c42115ea..3dba1336fa95 100644 > --- a/fs/btrfs/Makefile > +++ b/fs/btrfs/Makefile > @@ -7,10 +7,10 @@ subdir-ccflags-y += -Wmissing-format-attribute > subdir-ccflags-y += -Wmissing-prototypes > subdir-ccflags-y += -Wold-style-definition > subdir-ccflags-y += -Wmissing-include-dirs > -subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable) > -subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) > -subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) > -subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) > +subdir-ccflags-y := $(call cc-option, -Wunused-but-set-variable) > +subdir-ccflags-y := $(call cc-option, -Wunused-const-variable) > +subdir-ccflags-y := $(call cc-option, -Wpacked-not-aligned) > +subdir-ccflags-y := $(call cc-option, -Wstringop-truncation) But this overwrites all the previously accumulated values from += so effectively there's only the last one, no? That's not what we want.