Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3515519ybg; Mon, 28 Oct 2019 14:10:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPDapex42fZdQOioAK0Q0jKuP11O2dgzr0t2njcYtz6WnCDXqz2HQmYf+NRgiKb4POEAYS X-Received: by 2002:a17:906:742:: with SMTP id z2mr5200205ejb.32.1572297051672; Mon, 28 Oct 2019 14:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572297051; cv=none; d=google.com; s=arc-20160816; b=Sn9WvE8eaGc2z9ATfBjSHuFccxbYPg48F8yq1L4+/BB5Szth6uhhAT0uszVcmCkhZ1 roAuCAJh8Lxj4TpjCQmb4LEvqg4dUX68ydEfrisnNxS5pBCFnnoCHZMEqaMBEFCuHnFI R6J/CPgSHJJI2CMelAPRpDjrCqek8KfLLBnOkVpvPz+1u48RMRE596DvQ9neXpN3F6u/ 9WyxUz0ZC4Z+NRvTNd9hg4NojNk9ZmpGxn+/OmfIHL7aIrkDJ1LKoBMQkkaac+MCjVvr VpJ4bIHoMzaUeRcLpQh2QYekxR0id/igmuC06F4v/mc+LJaorhNw3SFjo55GI5/o0KIr 61Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=WjE1it8yeV6NqH0tm70xbwOdhHkrRFKKUt8sgnY+QSQ=; b=pmTwCqk8ko5EidjPU0Gv6s0NVxLgHh3PP6F/3jQ/A1DzJLWW/xIpIVCCpOSkaK4hQI VD5uDlvYZsA3tuy2LRNAFheXs7c4xmGJJuJKW5nMu/7PTpMFC3cp2r8RR4P0QBDe9vsk BTyDRUjMaMQywgSIuipGWqOlKMDUwpo4GQuH63t2jlncwXP5S1FZujQRrmEL5uX81kOz g7U7k7dIsB5KblD8cVWQpiMHMWIjXk51nTUpFB9PXCfrDR7xqvlPpE+WTfY9mnI6e3YI /UdVvdACNwTodjfwijVVwCED7jESJ/wcIuWB2SF9tAFQH0AmLzLEJX3gpg5Hhvp0xZoT 7Sxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Un9Bf5s2; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si8470576eda.406.2019.10.28.14.10.28; Mon, 28 Oct 2019 14:10:51 -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=@kernel.org header.s=default header.b=Un9Bf5s2; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390631AbfJ1POs (ORCPT + 99 others); Mon, 28 Oct 2019 11:14:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:48744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbfJ1POr (ORCPT ); Mon, 28 Oct 2019 11:14:47 -0400 Received: from linux-8ccs.suse.cz (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C6DB5217D6; Mon, 28 Oct 2019 15:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572275686; bh=3bA1CKw5DxLrwMigXlz2YeU695BAZLgPfS9g8yw1HeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Un9Bf5s2T7QD4LPjOLi56wXUz5Kr+M6mwuEXzVKgkqKfvDXDbqP9x9z3diFvuGUiW rldUkIJmPykn5jxrUvfXNJvpcVq9Il9mwsYEOZXlucPhh3MRy6yjk9+OSIN16iW2tC mslOyyPZiB/3frfK5CTDm35behHbI/XyHltDRbkA= From: Jessica Yu To: linux-kernel@vger.kernel.org Cc: Matthias Maennich , Masahiro Yamada , Jessica Yu Subject: [PATCH 4/4] scripts/nsdeps: make sure to pass all module source files to spatch Date: Mon, 28 Oct 2019 16:14:27 +0100 Message-Id: <20191028151427.31612-4-jeyu@kernel.org> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191028151427.31612-1-jeyu@kernel.org> References: <20191028151427.31612-1-jeyu@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The nsdeps script passes a list of the module source files to generate_deps_for_ns() as a space delimited string named $mod_source_files, which then passes it to spatch. But since $mod_source_files is not encased in quotes, each source file in that string is treated as a separate shell function argument (as $2, $3, $4, etc.). However, the spatch invocation only refers to $2, so only the first file out of $mod_source_files is processed by spatch. This causes problems (namely, the MODULE_IMPORT_NS() statement doesn't get inserted) when a module is composed of many source files and the "main" module file containing the MODULE_LICENSE() statement is not the first file listed in $mod_source_files. Fix this by encasing $mod_source_files in quotes so that the entirety of the string is treated as a single argument and can be referred to as $2. Signed-off-by: Jessica Yu --- scripts/nsdeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nsdeps b/scripts/nsdeps index 9ddcd5cb96b1..5055b059a81b 100644 --- a/scripts/nsdeps +++ b/scripts/nsdeps @@ -36,7 +36,7 @@ generate_deps() { | sed -E "s%(^|\s)([^/][^ ]*)%\1$srctree/\2%g"` for ns in `cat $ns_deps_file`; do echo "Adding namespace $ns to module $mod_name (if needed)." - generate_deps_for_ns $ns $mod_source_files + generate_deps_for_ns $ns "$mod_source_files" # sort the imports for source_file in $mod_source_files; do sed '/MODULE_IMPORT_NS/Q' $source_file > ${source_file}.tmp -- 2.16.4