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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 1C00EC433E6 for ; Tue, 1 Sep 2020 15:35:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D68BD20E65 for ; Tue, 1 Sep 2020 15:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974523; bh=ruD5cWIY+Ek85uJXcD6i8enXVkymOXbsy4UrpvC6r1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SMzntBlSqyHIO16biVV9CdOBeh77RSxg+ZTQlkPCi1GOL6svFy+LzvWUTIiGKpRjg Z9rKKUvAf7ekhXyiOebx7mUjG+8VlEygMCf1qcQs08LNUFQ6V0KLcXh3oXtMpsJU9n Xb3nautVIKl+N/S5CjOMddk283hUnBDVxNnhw3wQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731152AbgIAPfV (ORCPT ); Tue, 1 Sep 2020 11:35:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:40924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731218AbgIAPfT (ORCPT ); Tue, 1 Sep 2020 11:35:19 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD30120E65; Tue, 1 Sep 2020 15:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974516; bh=ruD5cWIY+Ek85uJXcD6i8enXVkymOXbsy4UrpvC6r1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bJKqqXApW03dKnXsL99+4gumjQzAbCW1Nlk0CyYkY71QIXhGczmRdvSDMEI9TyA2m XEDj42BEglwqe+mInLPW1qVGSRVzQXqQ4eKpGP7rrjeuCJebnQUzD4Syt68IyZTKyA YC5dCymxIvJ21j4LAgMEghLJMLaH+WhK2o5v2HiE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Matthias Maennich Subject: [PATCH 5.4 207/214] kheaders: optimize header copy for in-tree builds Date: Tue, 1 Sep 2020 17:11:27 +0200 Message-Id: <20200901151002.845982333@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150952.963606936@linuxfoundation.org> References: <20200901150952.963606936@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada commit ea79e5168be644fdaf7d4e6a73eceaf07b3da76a upstream. This script copies headers by the cpio command twice; first from srctree, and then from objtree. However, when we building in-tree, we know the srctree and the objtree are the same. That is, all the headers copied by the first cpio are overwritten by the second one. Skip the first cpio when we are building in-tree. Signed-off-by: Masahiro Yamada Signed-off-by: Matthias Maennich Signed-off-by: Greg Kroah-Hartman --- kernel/gen_kheaders.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -56,14 +56,16 @@ fi rm -rf $cpio_dir mkdir $cpio_dir -pushd $srctree > /dev/null -for f in $dir_list; - do find "$f" -name "*.h"; -done | cpio --quiet -pd $cpio_dir -popd > /dev/null +if [ "$building_out_of_srctree" ]; then + pushd $srctree > /dev/null + for f in $dir_list + do find "$f" -name "*.h"; + done | cpio --quiet -pd $cpio_dir + popd > /dev/null +fi -# The second CPIO can complain if files already exist which can -# happen with out of tree builds. Just silence CPIO for now. +# The second CPIO can complain if files already exist which can happen with out +# of tree builds having stale headers in srctree. Just silence CPIO for now. for f in $dir_list; do find "$f" -name "*.h"; done | cpio --quiet -pd $cpio_dir >/dev/null 2>&1