From patchwork Tue Sep 1 15:11:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 248905 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6447:0:0:0:0 with SMTP id l7csp3692057ejn; Tue, 1 Sep 2020 08:35:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRhXsj1+8uhuPK6qLJyAO9/l7C1Hgn0I2aFFQhyH+acbkiUOmtlna1kl/jyVV6oRVmBNRR X-Received: by 2002:a17:906:2d42:: with SMTP id e2mr1906625eji.10.1598974524136; Tue, 01 Sep 2020 08:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598974524; cv=none; d=google.com; s=arc-20160816; b=FBZVz9sbRzwdOHyEzB3zOVs8mvjLtFYKM6RGUoEq1GqNv7WpD7/8m+L9TYPNPw8iHZ j9r7dZTVj5q01sUvqGwrGUCdK8hC9kKRjrSV/U1lvT+nFVSR0ozwt+aGk7cbjk1W/p8L dpaZp56BpH1A21Cbqywf8xTK5SO00TaywZALDZt9sQ8Gz1GICyRIyFzn97+jtLjZI57b z4s5ZnnA0/2hPP6Nw5DhhbJKKRByg112h91hxbspZM7WS4ANDJ1pYYVhdHVeRf4TZh1y L1DNkP0O27lWMi0N+y9i2FgeaX7PzTkvMfwucYS3AknUmWOaiYvINAo6hteQqI47Di/k 4UYA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nsSUreLD2xpEvFDhWwWQ83a/irE1RRfdjEJhJ/BeJcI=; b=AyKcLzu7ZSbZkn36xRqJYmPqQWYleAB9Ic+Qs7+Rd6krS5UQumqDgem9XjJJ92aM7W kePK2CrEEubW5l1FFTBfjbern4iVB+yixm1EbGyWjGLS0VGFK7M6dCGQ2iegxaL5WK8M jwJ8nnmQcl00TGB91BOX5cqkImcrxA1RAtySoEMIrmSTRYWHRK7v6Nl64RunLwMHEV6d GBBKKN6DW+bng2ynnS0kITReNjfPODDeKjpcuAnT7xSFxIJ2m59NKi29A0wIHL8c8RxX kfuV6w+q02dify9QFKPLZ/NWsKV0Y6AivasxAfRUEr9Y5QJhDWc64wSW93IAMWcZmCi3 VySQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bJKqqXAp; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si760354edy.601.2020.09.01.08.35.23; Tue, 01 Sep 2020 08:35:24 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@kernel.org header.s=default header.b=bJKqqXAp; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731152AbgIAPfV (ORCPT + 15 others); 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 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