Received: by 10.223.185.116 with SMTP id b49csp6135641wrg; Thu, 8 Mar 2018 02:21:52 -0800 (PST) X-Google-Smtp-Source: AG47ELsSdnafuPcY3AWeAOyB6IJM30neyXPApFTImscFV4ysMqxaZFPA5Mkq2fPmdzgiI3C90jbo X-Received: by 10.101.97.26 with SMTP id z26mr20941148pgu.44.1520504512005; Thu, 08 Mar 2018 02:21:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520504511; cv=none; d=google.com; s=arc-20160816; b=e8kBCDBni69TVMYVyuD3FGosBzB8nHwFgQnmYrKEZTfoXA8attW+soPTZp8mndDfOJ Uw/Qwm3m2dqgz5KOB9P1UcAlXIwPZjdq59Ookghan+zGG/Rhf6JRHh85dC0GD8CJQiap JS5gWWctU/B28AkBFCJbCERhBMLAgg6uUGv/JwF8q7Ok46TLqBS6n/MP4OCPYRdYWbAc 02W/H2189GpuWRxXiqx0agOM/FB/UJKhp6EQR3aC8T7ho8aAXvtKi/kQuNJrW5O52zdG kAK6hrCTNRi94YEDc9cgQJ3Mco/XJzC5jaTT4C+inOFrtpcjtqF/66EydE60pPiGd/Bg idZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=JkAdT9RHu0OcQozZJRdXbkCCgJtZLwrYC1GSo5njXHY=; b=KpJ1t6k3cbE/lBtLU7eYaukFmCzMuTPuTG+uCwOeww9qjdMUbNE7H3Y6TKaE9/wPkL VluS0ZKpHJOdyEUWlF297O7dwpfzJVwOQ40mkgyGJttYUXqhvMCJZGSJQ85tZ5V3+v+5 CPaRfMHr5uyHbehaCj3GYJXxgkxI5YWJ5o4CS5liPIJXw365Ag2Ep1Yn0qsoBArTVLeC s6Nq6ADVPR12f7IFD+N0Ss2NFSiqJwDyV6WtnyiCQmbfrDyMRM2Otrmp3y8FwhLPkqfM 0+I6Hu0Swn39jbX7/TiJy9kvq1lMQXVJ/Tsiaavfak3v3H1KVoAqFGtJsTuMqA+cGViW vhmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r65si15709349pfe.295.2018.03.08.02.21.37; Thu, 08 Mar 2018 02:21:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934899AbeCHKUt (ORCPT + 99 others); Thu, 8 Mar 2018 05:20:49 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:40148 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755373AbeCHKUr (ORCPT ); Thu, 8 Mar 2018 05:20:47 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="37611897" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 08 Mar 2018 18:20:43 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 1DE4B48AE762; Thu, 8 Mar 2018 18:20:41 +0800 (CST) Received: from [10.167.226.60] (10.167.226.60) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 8 Mar 2018 18:20:38 +0800 Subject: Re: [PATCH 1/5] kbuild: remove unnecessary $(subst $(obj)/,,...) in modname-multi To: Masahiro Yamada , CC: Sam Ravnborg , Michal Marek , Govind Singh , Kalle Valo , References: <1520471103-10089-1-git-send-email-yamada.masahiro@socionext.com> <1520471103-10089-2-git-send-email-yamada.masahiro@socionext.com> From: Cao jin Message-ID: Date: Thu, 8 Mar 2018 18:19:52 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1520471103-10089-2-git-send-email-yamada.masahiro@socionext.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.167.226.60] X-yoursite-MailScanner-ID: 1DE4B48AE762.A61CF X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: caoj.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/08/2018 09:04 AM, Masahiro Yamada wrote: > In the context ... > > $(obj)/%.s: $(src)/%.c FORCE > $(call if_changed_dep,cc_s_c) > > $(obj)/%.i: $(src)/%.c FORCE > $(call if_changed_dep,cpp_i_c) > > $(obj)/%.o: $(src)/%.c $(recordmcount_source) $(objtool_dep) FORCE > $(call cmd,force_checksrc) > $(call if_changed_rule,cc_o_c) > > $(obj)/%.lst: $(src)/%.c FORCE > $(call if_changed_dep,cc_lst_c) > > '$*' returns the stem of the target (the part of '%'), so $(obj)/ has > already been ripped off. > > $(subst $(obj)/,,$*.o) is the same as $(*.o) > > Signed-off-by: Masahiro Yamada > --- > > scripts/Makefile.lib | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index 5589bae..a7e315f 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -175,7 +175,7 @@ dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ > > # Finds the multi-part object the current object will be linked into > modname-multi = $(sort $(foreach m,$(multi-used),\ > - $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) > + $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=)))) > > # Useful for describing the dependency of composite objects > # Usage: > A subtle catch! And in my test, a debug line     $(info $@ = $*) in rule:     $(obj)/%.o: $(src)/%.c xxx does tell me it is correct. So, Reviewed-by: Cao jin -- Sincerely, Cao jin