From patchwork Tue Oct 8 12:05:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 175481 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5610159ill; Tue, 8 Oct 2019 05:06:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhMCh6vdSjhipClVQdLt6bQayqyK7X+S2kM1oTICL4uO1KFhFHJljrbcQhPjYOEZIrPD6V X-Received: by 2002:a17:906:9395:: with SMTP id l21mr1709576ejx.161.1570536417911; Tue, 08 Oct 2019 05:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570536417; cv=none; d=google.com; s=arc-20160816; b=j0RFRNWz87SybJYE30OAnoDXUD2SG8ep5HDFMJHBKjzSxQbMYkuWHEfH9qE6CRBW6j qHQyTmaBLRcE3GJdlxiok6hjpwURLZER7KET8R/gkEGFxq2ENWNhugWxvPcPZ3+kEP5X +GZQK0B8113cp9EdDWK/n3N7MIOENl7B8slKd2o6yKsNWJj0vI1cp9Xhqs12J68wA5ZV AtzwL/2mzWOLPSg9FE+RtHnxdAtufOthu8qFnnCudpMf2mtLkWhDPpQJgTeFJe1Efmt/ d6DPGAjV7EnG2JcpfzF90og8oYUgpozQ8FcUcq3RnMK6ktQ+GsqM5DPE/IB+esQh/C7X C4ZQ== 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=5sMplte1orpkOBofj2bSvoYhmGY/7D1FKE2MtMgI2c0=; b=ViIs8AHrBkaw1VTr2SCo1+6LWw/EPQP75tmOWm8t4Ou9mcPZdFTdsS7pXUZATNS6eg Bu0HcJ+bsbh/LjZrwjG0ny/8ymQU4vFePrN+4/UeVbguc4Do6HJaI6/MVaIAmTUi2qbe 5/dVogNmHuMviiHSmB5UiSrNhbb5jBuY8aYdK0JubldUCkfFy7yDEiFHe92R/Udf1c4/ em4pn5vu6It8Ab5Dr33oSCDuNzN0LBQE92tov3eQq67RGG9Uo59oDMqzCl7FmAxgiGZC n14s7TGGJ00QNXor9K5Vc2T6mRnOR1ylDP2tP6mWVfy7sF2XR0dxRqTmFSgY4Ren1Zv6 KfEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=IOQ7bFge; 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 v9si7451923eju.406.2019.10.08.05.06.57; Tue, 08 Oct 2019 05:06:57 -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=IOQ7bFge; 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 S1731013AbfJHMG4 (ORCPT + 26 others); Tue, 8 Oct 2019 08:06:56 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:28280 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730727AbfJHMGn (ORCPT ); Tue, 8 Oct 2019 08:06:43 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x98C6133021176; Tue, 8 Oct 2019 21:06:01 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x98C6133021176 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1570536362; bh=5sMplte1orpkOBofj2bSvoYhmGY/7D1FKE2MtMgI2c0=; h=From:To:Cc:Subject:Date:From; b=IOQ7bFgeGXun0TVQbxqC2WiLnBmTXZJ29pNWIZOiuQ4PdzzSneeEoT/1cYhD4lEX6 OrpTDrJxbx2/LOImspUh8yHQKHPo3r+UdwAI8j2kzXBV8S3lSN9Il+xqjGQG3iCL0L m/qA3wQQNmanGuxtEkXuWfQIKvenYeGMNTwdijJj5sWX/npbg4KyZAIG/NpL7zvoPD XhreK5JkAxhlNBLmDyDosTRUC4cYbAaORTr+MpQlB62yDTOGpHneft7FLJX/smuXJs hKZraK5ERsohMeC7TbYfm6w0++8827zMXqB3fYmd5c8fDS78xiTkUIFAf1gMDosYHp W/RBZl3FlCcew== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Greg KH , Joel Fernandes , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] kheaders: remove unneeded 'cat' command piped to 'head' / 'tail' Date: Tue, 8 Oct 2019 21:05:52 +0900 Message-Id: <20191008120556.4263-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 The 'head' and 'tail' commands can take a file path directly. So, you do not need to run 'cat'. cat kernel/kheaders.md5 | head -1 ... is equivalent to: head -1 kernel/kheaders.md5 and the latter saves forking one process. While I was here, I replaced 'head -1' with 'head -n 1'. I also replaced '==' with '=' since we do not have a good reason to use the bashism. Signed-off-by: Masahiro Yamada --- kernel/gen_kheaders.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index aff79e461fc9..8aa6d3c37ba7 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -41,10 +41,10 @@ obj_files_md5="$(find $dir_list -name "*.h" | this_file_md5="$(ls -l $sfile | md5sum | cut -d ' ' -f1)" if [ -f $tarfile ]; then tarfile_md5="$(md5sum $tarfile | cut -d ' ' -f1)"; fi if [ -f kernel/kheaders.md5 ] && - [ "$(cat kernel/kheaders.md5|head -1)" == "$src_files_md5" ] && - [ "$(cat kernel/kheaders.md5|head -2|tail -1)" == "$obj_files_md5" ] && - [ "$(cat kernel/kheaders.md5|head -3|tail -1)" == "$this_file_md5" ] && - [ "$(cat kernel/kheaders.md5|tail -1)" == "$tarfile_md5" ]; then + [ "$(head -n 1 kernel/kheaders.md5)" = "$src_files_md5" ] && + [ "$(head -n 2 kernel/kheaders.md5 | tail -n 1)" = "$obj_files_md5" ] && + [ "$(head -n 3 kernel/kheaders.md5 | tail -n 1)" = "$this_file_md5" ] && + [ "$(tail -n 1 kernel/kheaders.md5)" = "$tarfile_md5" ]; then exit fi