From patchwork Tue Jun 25 07:26:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 167683 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp5201744ilk; Tue, 25 Jun 2019 00:28:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKKezzADI0F07lpj5pBlFyckbEm9sp3b9r3ma98wMumu4DYjrCgy3f+FvCaZhF1YmsJUwj X-Received: by 2002:a63:1365:: with SMTP id 37mr9670556pgt.266.1561447700247; Tue, 25 Jun 2019 00:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561447700; cv=none; d=google.com; s=arc-20160816; b=O/zdN/yVk1CpkzDO9PlZsh6hmYJlpT3O3eGfifbVmdoLeDaVzJBWUdVdJTJ2pTFDsh hULwCUvY2OnErki3bivqA3jxEhzcsIaHKoHWTXYKd1uUhPGpVAZa3z5LRKs8Ud1wTI+o 4ZZbL4wflTFO70KGqI2+G+Kx8EzRvQbpM/U+gM+QLXjHG/pTdLVHk3DGv/RvRqzxb0mN JyY1BMCJElg3qBRBHKkMNmQ5VUEWDMxAOmjseTVx4UhDEzULafMbK8X9WZAnDQelsyIh U/2/uw6wuFni2fZuDGQFDnEXbScR6hFiWG2FbJTM8/nj92uW4iRzf344dsNHcMrCGUHB FJtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=5AaDSiMBTC0S/hgXdywuV5MWuEsJ//DnTJVaKA14u9c=; b=Qfa6KHybkex5GenllfWO3J5LZB6hsS4glhiUkFcBVTbSbcmhCam7FzMPwfw36A2sjV qzWgRsu/++mpWhjwlboWUKYrPDuXdhY3OQnLuj83es3959Zs1u/Tu3ix/roMmKbhzZON zeKvt4Dw9U6MYOKmed4P9loPPv78cVqPs8WEpHwuohwN9pmdUujbRJK8oKJkxo2IulEI yOeI0FH3/e82uM+1u2yKwMd/3wd/HFF3WeeEEbpWEwWckRcXUYFdcjGsfZh/zB7QIu6t H74bNd9DLmwczULa4a1ClN4SrhA0bgGUwJ5qUf2+93C9y//RTquuwmbka3HyRAJ1eeQr 0d3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0cm5Hn+D; 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 b5si13436290pfd.273.2019.06.25.00.28.19; Tue, 25 Jun 2019 00:28:20 -0700 (PDT) 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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0cm5Hn+D; 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 S1727316AbfFYH2S (ORCPT + 30 others); Tue, 25 Jun 2019 03:28:18 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:47154 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726835AbfFYH2S (ORCPT ); Tue, 25 Jun 2019 03:28:18 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x5P7QdLL027637; Tue, 25 Jun 2019 16:26:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x5P7QdLL027637 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1561447599; bh=5AaDSiMBTC0S/hgXdywuV5MWuEsJ//DnTJVaKA14u9c=; h=From:To:Cc:Subject:Date:From; b=0cm5Hn+D125z52GdMOnXdaEPCEsdcEhXfLpSzQ3SCrTKU91clpc4VaBk6CG6PJI0h WjpI3Jsg5/USglOojuGprz2LUCpofbpGn+ANvqa3qdbdOptDHFNpjyTkgKnYy/MiM1 i0mAxtxcm8KXCfzsazvZhgmt+/cgo3Qo+uOxI//A3y2Au+LyAqiOq6kAVVNZmZLai8 Ib3LI/OjioN6qZVCj1ns1aPeLZF3Uk+q4UzDmlEgljGElYN8zCIQ8KwIGmBDwELgyS UJrK9CuEMGuPQWqJpZ0VisQW4Ks4i/Sed4KSlVWtpf5CzgF1VozLCVf9YMS19JlhGM MV71wsHjwPjFQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Ingo Molnar , Thomas Gleixner , x86@kernel.org Cc: Masahiro Yamada , "H. Peter Anvin" , Borislav Petkov , linux-kernel@vger.kernel.org Subject: [PATCH] x86/build: add 'set -e' to mkcapflags.sh to delete broken capflags.c Date: Tue, 25 Jun 2019 16:26:22 +0900 Message-Id: <20190625072622.17679-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Without 'set -e', shell scripts continue running even after any error occurs. The missed 'set -e' is a typical bug in shell scripting. For example, when a disk space shortage occurs while this script is running, it actually ends up with generating a truncated capflags.c. Yet, mkcapflags.sh continues running and exits with 0. So, the build system assumes it has succeeded. It will not be re-generated in the next invocation of Make since its timestamp is newer than that of any of the source files. Add 'set -e' so that any error in this script is caught and propagated to the build system. Since 9c2af1c7377a ("kbuild: add .DELETE_ON_ERROR special target"), Make automatically deletes the target on any failure. So, the broken capflags.c will be deleted automatically. Signed-off-by: Masahiro Yamada --- arch/x86/kernel/cpu/mkcapflags.sh | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/arch/x86/kernel/cpu/mkcapflags.sh b/arch/x86/kernel/cpu/mkcapflags.sh index d0dfb892c72f..aed45b8895d5 100644 --- a/arch/x86/kernel/cpu/mkcapflags.sh +++ b/arch/x86/kernel/cpu/mkcapflags.sh @@ -4,6 +4,8 @@ # Generate the x86_cap/bug_flags[] arrays from include/asm/cpufeatures.h # +set -e + IN=$1 OUT=$2