Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp762139ybl; Thu, 22 Aug 2019 04:36:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRZAgJgn8wseJbRjsJj1aU3Zdh5nBpVm8EaXt28Z9e3OFRHTL6ACromw2L3DXL3uhp6lKh X-Received: by 2002:aa7:9217:: with SMTP id 23mr41474606pfo.239.1566473794213; Thu, 22 Aug 2019 04:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566473794; cv=none; d=google.com; s=arc-20160816; b=y1hnF+scCK+vIXzoUi+mWGO5biB3e6J13bx3afRM4DILOomorILM9PPhxYvv3CMOhN DVfgTVhc7+cFi2AervhK+1gN9CgKBi4Cj+hsA4Ft9VpDEKDG7DX4qFhX3hSiERRpPL2f +HZIIAb9xc8aXZf+Quui73weUbXYa1mdwh28QvTo9CX/WCRZb9hi/lEva2kAHY7HLKsu fOAX+wRymEY8XEemwEM2Z58zlHZLa7OFl2hhvRsUQG3o8tuNh/0pXO5r8Xfx4gvb+rgF DcD1fXDjyXNDT1Rm1EXElNeOmGdmE0+EHLUj0NT/CUQxRosjHzSiYFftYgfE8VgAAAIH H0YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8fMTG6N2j/TMUB2P1ujx2DtHjddT/TmmdRfnCuZ9XY0=; b=PIa2El2s0rDqvnMMGeAyHFClj/vK+1TUpGdfaLhwmtdTSnov4BF2iFAVsDTS8L8I5T DJpASjq/Cmuq5E+YKIPlYVy8w+njocwkCdErDLS4BD5Kfi7kLy8//DVe5LkxKrkbbeEs Bs0y0q6uQNKZQSSdjEgfteKAfMYZZGsdLVtB4LWjYoWyOAhi8At6VQjgbV2jVkuc9TOq 13e6tk/9D6qczHOtiUhJdbHBRGe+4fAUAfYQ5t0AKgqyToJiAsyckOV4YfsMMFcz9rbG mra8O3q+wW1Ikp50EGjjPEDywmkUD9MFEYeN2SRjoe1IghXZncriFlDdoIg3WxW4OWrC TOhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=T2pMI6y+; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m17si856821pff.107.2019.08.22.04.36.19; Thu, 22 Aug 2019 04:36:34 -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=@google.com header.s=20161025 header.b=T2pMI6y+; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733164AbfHVJTH (ORCPT + 99 others); Thu, 22 Aug 2019 05:19:07 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:32812 "EHLO mail-wr1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733152AbfHVJTF (ORCPT ); Thu, 22 Aug 2019 05:19:05 -0400 Received: by mail-wr1-f41.google.com with SMTP id u16so4709443wrr.0 for ; Thu, 22 Aug 2019 02:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=8fMTG6N2j/TMUB2P1ujx2DtHjddT/TmmdRfnCuZ9XY0=; b=T2pMI6y+G8IKrsK8J/v9Hw6Ze7VNU1QAegTQBtAa7YoAqIMV7jl4rsOxqLr2uKv+7E qU8OpzWDLx9aa2GeALCMNY10DH8xUmpEvSQpL0ayo6EJseiHy6wUP019c/nCCacrOqhB QB+3d2H2f0vEl7LtOw9XPlAwhFizRTqjD3JcaH9+n+VKUvYDS9r4fRpDwq0+iXaszL13 J3sknRZdTSR9IJXI8txUWEFdl9+uB5tH3eqzTb0H6t3MUJTXPo1J+pZxj4+FMYBI1PHv B9TvUD/P3C3CaL5RpMtkMMjLBIWW2hdg5F7iwFp/hNbtITgX9r32GojgJ+PW0XbAEkM3 Pdcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=8fMTG6N2j/TMUB2P1ujx2DtHjddT/TmmdRfnCuZ9XY0=; b=jVYcViecFfH3rhfw3n0Oh6lK/5oYpml9zawXSUoCBSCs8wJnHyMsRRM6/qtfWA+rLx 89ZdEer774j/LU5QWLsVj8gHk4kF63mL7SBcaXM3SJcyf9aajnII+Sf+xDEg1Lg9nxnq +SiG6Y1D5duHcWDbsb0IE0Yjplqcx9PSEabghcWb7y8UoU1hjkm94Dpag27OECk/yFnm dnfTOUbPmHB2yKHI3hS3pKGje3YuRP6E/96bIR4nrBybkRX5ndoQiwSICJeyA9Sf8KSl bvh85ISIVRy9apI0qVK+ZaHdyIZgSFe1XmvCz7/X8FjPKaFWjdLpSQblSp0I1k/Hfq8f 0J4Q== X-Gm-Message-State: APjAAAVRAo8tr5QP2Nz65sqdfXh7HI2Jh/WugqyqRnVpnNBWzf1pJ/vl gp5h3jFqOoHZHztJWbTpfVm8pw== X-Received: by 2002:a5d:4101:: with SMTP id l1mr4986587wrp.202.1566465543440; Thu, 22 Aug 2019 02:19:03 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:e8f7:125b:61e9:733d]) by smtp.gmail.com with ESMTPSA id 4sm46118162wro.78.2019.08.22.02.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2019 02:19:02 -0700 (PDT) Date: Thu, 22 Aug 2019 10:18:58 +0100 From: Matthias Maennich To: Markus Elfring Cc: Greg Kroah-Hartman , Julia Lawall , Martijn Coenen , cocci@systeme.lip6.fr, kernel-janitors@vger.kernel.org, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-modules@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, kernel-team@android.com, usb-storage@lists.one-eyed-alien.net, x86@kernel.org, Alan Stern , Arnd Bergmann , "David S. Miller" , Geert Uytterhoeven , Gilles Muller , "H. Peter Anvin" , Ingo Molnar , Jessica Yu , Joel Fernandes , Jonathan Cameron , Kate Stewart , Lucas De Marchi , Martijn Coenen , Masahiro Yamada , Mauro Carvalho Chehab , Michal Marek , Nicolas Ferre , Nicolas Palix , Oliver Neukum , Philippe Ombredanne , Sam Ravnborg , Sandeep Patil , Stephen Boyd , Thomas Gleixner Subject: Re: [v2 08/10] scripts: Coccinelle script for namespace dependencies Message-ID: <20190822091858.GA60652@google.com> References: <20190813121733.52480-9-maennich@google.com> <1c4420f4-361c-7358-49d9-87d8a51f7920@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1c4420f4-361c-7358-49d9-87d8a51f7920@web.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 15, 2019 at 03:50:38PM +0200, Markus Elfring wrote: >> +generate_deps_for_ns() { >> + $SPATCH --very-quiet --in-place --sp-file \ >> + $srctree/scripts/coccinelle/misc/add_namespace.cocci -D ns=$1 $2 >> +} > >* Where will the variable “srctree” be set for the file “scripts/nsdeps”? > $srctree is defined by kbuild in the toplevel Makefile. >* Would you like to support a separate build directory for desired adjustments? > No, as the purpose of this script is to directly patch the kernel sources where applicable. >* How do you think about to check error handling around such commands? > > spatch emits a descriptive message on error. I will add a 'set -e' to the script so that it aborts on errors. >> +generate_deps() { >… >> + for source_file in $mod_source_files; do >> + sed '/MODULE_IMPORT_NS/Q' $source_file > ${source_file}.tmp >… > >I suggest to assign the name for the temporary file to a variable >which should be used by subsequent commands. I somehow don't agree that this is an improvement to the code as the variable would likely be something like ${source_file_tmp}. Sticking to ${source_file}.tmp does express the intent of a temporary file next to the original source file and the reader of the code does not need to reason about the value of ${source_file_tmp}. Cheers, Matthias