From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A9444534A8 for ; Tue, 14 Jul 2026 12:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031943; cv=none; b=G4dgltWPavy43chgZY0vaucJbZSPWiTtPCRE/fMbyNBSXjGjLsXvckF2UZgUkBAuQ2LOi3vIw/aLQzyVl88nWhHTEaZbbWO0y32Nhci4AW+PuaAWaxPZe8ueIS/0JDNuh41KDOc+g7ivXWwmnfCGVl6mxVKdYexQiXmsRowq75E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031943; c=relaxed/simple; bh=J6NlgFsAKVrRbc9Bh9K1zEA5jJs7eG1zbZHbBQ6rkqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CWwgr3D7dmJfyEtE6n9QoCY/kh9F+2v+6Oc7E8w+CxzZ8JqfVvyxbUVxDf8X6VJzYPyZzqwPJh04bjMnc/JzC1juMLReKO+RMXHdhkiedsJfOK44RnSjM4dqbJ6SC4BO+IJWz8D6VrAWfVlo1jV7jfIvCSaVxZobSq9bJhMqLmc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=huMDaOTL; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="huMDaOTL" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-47db714766aso533003f8f.0 for ; Tue, 14 Jul 2026 05:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784031929; x=1784636729; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=2ncG6NWUejHTeECNrJBlBEYBi8S2JGts4XbtecPD+Mg=; b=huMDaOTL1YTn7uHZUwoZFpnn6KrohmwK+rpKzhrCxoOj2zVCQZJRFQGsLGRE4Zk2rD 7IBWcW/ul4sie0aFzqYuHJav5kDWYVf/zzfX76exbXPJwUQhshrWPxAMZyYgcJROESWN rid1n0DKxw0PLgHb87vewmfEshavGS1etEQCFpoUGwHkQPrqXcPoFeTUITDy7yDuarJW ZB0EiIUq/buk8mUamT6tDvOZ+Tbk3wFX0vCZtOhtEFkCRMIq+zMj9JL/GdfBxFi0EQJo w50s0OB4tUgk7xaHY1Uzbkim22HgGzR3cUz5z8/p2jpnS1zWz42Ff0I1RfcUYNAC0Vo8 jUog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784031929; x=1784636729; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2ncG6NWUejHTeECNrJBlBEYBi8S2JGts4XbtecPD+Mg=; b=rFjYEEyCfjSZB4kvBRvBOw9Cg01Q1fmdN98Np5gtOXJhL0Wd/3O5C/McrdD42KXUVq rHWQNUGlsjVBi4z0pUbFzxQzlsj37t4fOnWw0hhh2r2xGMdQRivm4qa3Zle63eZpSo9s JJX5NoMHjbUU5fzahtnSUu/d+L2YsUXfsB1ZUxXRT9beBOg8b0+Fz5+GnPLAhHkLrHZO pPxk56SCwz/OovgUcR30TT3WPDm8afxSjK+hUWPXSU6QLEAU1++qa5Cs8dEjg2w1uhO2 WK8erJIOf43CZ4YJsHOJQpHIfkGwEMjfZuWvbpQpQKxoTATJcpmRD9RU4wlUd+2ffWt6 OkCg== X-Forwarded-Encrypted: i=1; AHgh+RrMkGvLdMU0pXAgYsFpbPkipjg05NJEXYWxS3OugjALkG/NSxc0EV/f9AcCJ5lbxGTotmoD2PxqH4Ikhb8=@vger.kernel.org X-Gm-Message-State: AOJu0YwpQ8thWN8CU5KGx+5CdC/FdhkLKFHVjvAXAyrlVgbN5Tu93JLX EvnMHT3YUKZQK9l9wOyzLdsU7ZHjWGChaS76kfxXxejFimn/CEkF2fMG X-Gm-Gg: AfdE7cl5ST1LxNknAKookAslRWEQN/YdYwZAzCL57OLSQhQ2jNXbhso8HcYaUKMgsRf g0A6PftIV8L9EtGoMXv5uWgmdm6t1Hi9EPoOUE6gk/6mlOE94a6dFIVDhWNBQ7kLDe/sfAKAKam TPibQ2L3SpKTFEEhRjhKcRiQIMgOH9PsCq5cHpYV8tfAKjLFkpYP2yDkH1hxZQfY4HoMjS5PJfc 6l38QwQRF9nMF6J8w1wxcPHO/EqyE83YP/uJtOEuEq9MyzARHdDp/fsYuUn0wIbPaPDcJx1qAnn IUYp8HRLjhIvG3L5crsCv3tNnbeJhsWVGRbFIW0/9l55VDg/cCNehD1pgO1U/8oBEM9kVUO+pbt VC3W8e89T5jmSQyGHn+1pkjlwVJotJoLIrUaCMr40qvVarWatbo3lwqUB1RirVpfT/SzuU5twfi 9o4q2SYw15oeunQEbjDwZB/6LXkeyoG9Gedw== X-Received: by 2002:a05:6000:2f86:b0:46b:70db:2113 with SMTP id ffacd0b85a97d-47eee0b8778mr21935039f8f.0.1784031928859; Tue, 14 Jul 2026 05:25:28 -0700 (PDT) Received: from localhost (a89-182-201-216.net-htp.de. [89.182.201.216]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-47f4635ac2esm8026897f8f.13.2026.07.14.05.25.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jul 2026 05:25:26 -0700 (PDT) From: Sergei Litvin To: miguel.ojeda.sandonis@gmail.com Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, ojeda@kernel.org, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, daniel.almeida@collabora.com, tamird@kernel.org, acourbot@nvidia.com, work@onurozkan.dev, nathan@kernel.org, nsc@kernel.org, Sergei Litvin Subject: [PATCH v3] scripts/tags.sh: Add support for rust source files Date: Tue, 14 Jul 2026 14:24:41 +0200 Message-ID: <20260714122441.78158-1-litvindev@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When executing the command `make cscope`, the `cscope.files` file generated by it includes only filenames with the extensions *.h, *.c, *.S and not includes filenames with *.rs extensions. To fix this, modify the functions `find_arch_sources()`, `find_arch_include_sources()`, `find_include_sources()`, and `find_other_sources()` so that they can accept an unlimited number of filename patterns as parameters for the search. Add the `setup_name_pattern()` function to convert these filename pattern parameters into a list of parameters that can be passed to the `find` utility via the new `pattern` variable. Cc: Miguel Ojeda Cc: Boqun Feng Cc: Gary Guo Cc: Björn Roy Baron Cc: Benno Lossin Cc: Andreas Hindborg Cc: Alice Ryhl Cc: Trevor Gross Cc: Danilo Krummrich Cc: Daniel Almeida Cc: Tamir Duberstein Cc: Alexandre Courbot Cc: Onur Özkan Cc: nsc@kernel.org Cc: nathan@kernel.org Signed-off-by: Sergei Litvin --- This is the second part of this patch: https://lore.kernel.org/lkml/20260602121521.11650-1-litvindev@gmail.com/ which I have split into two parts, as suggested by Nicolas Schier here: https://lore.kernel.org/lkml/akVkIrcpNxZrrfii@levanger/ Changes since V2: https://lore.kernel.org/lkml/20260714083709.69517-1-litvindev@gmail.com/ as suggested by Miguel Ojeda here: https://lore.kernel.org/lkml/CANiq72k0RbkWk=8hiNzHUmFWr=6OA2DBHAUew4OfZb_Umb=6hA@mail.gmail.com/ - Remove "Cc: stable@vger.kernel.org" tag, because this commit introduces a new feature. --- scripts/tags.sh | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/scripts/tags.sh b/scripts/tags.sh index c9dc2763a505..41e38df96984 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -46,13 +46,31 @@ elif [ "${ALLSOURCE_ARCHS}" = "all" ]; then ALLSOURCE_ARCHS=$(find ${tree}arch/ -mindepth 1 -maxdepth 1 -type d -printf '%f ') fi +setup_name_pattern() +{ + pattern=() + for ext; do + if [ ${#pattern[@]} -gt 0 ]; then + pattern+=("-o" "-name" "$ext") + else + pattern+=("(" "-name" "$ext") + fi + done + if [ ${#pattern[@]} -gt 0 ]; then + pattern+=(")") + fi +} + # find sources in arch/$1 find_arch_sources() { for i in $archincludedir; do local prune="$prune ( -path $i ) -prune -o" done - find ${tree}arch/$1 $ignore $prune -name "$2" -not -type l -print; + local src=${tree}arch/$1 + shift + setup_name_pattern "$@" + find $src $ignore $prune "${pattern[@]}" -not -type l -print; } # find sources in arch/$1/include @@ -61,14 +79,17 @@ find_arch_include_sources() local include=$(find ${tree}arch/$1/ -name include -type d -print); if [ -n "$include" ]; then archincludedir="$archincludedir $include" - find $include $ignore -name "$2" -not -type l -print; + shift + setup_name_pattern "$@" + find $include $ignore "${pattern[@]}" -not -type l -print; fi } # find sources in include/ find_include_sources() { - find ${tree}include $ignore -name config -prune -o -name "$1" \ + setup_name_pattern "$@" + find ${tree}include $ignore -name config -prune -o "${pattern[@]}" \ -not -type l -print; } @@ -76,23 +97,24 @@ find_include_sources() # we could benefit from a list of dirs to search in here find_other_sources() { + setup_name_pattern "$@" find ${tree}* $ignore \ \( -path ${tree}include -o -path ${tree}arch -o -name '.tmp_*' \) -prune -o \ - -name "$1" -not -type l -print; + "${pattern[@]}" -not -type l -print; } all_sources() { - find_arch_include_sources ${SRCARCH} '*.[chS]' + find_arch_include_sources ${SRCARCH} '*.[chS]' '*.rs' if [ -n "$archinclude" ]; then - find_arch_include_sources $archinclude '*.[chS]' + find_arch_include_sources $archinclude '*.[chS]' '*.rs' fi - find_include_sources '*.[chS]' + find_include_sources '*.[chS]' '*.rs' for arch in $ALLSOURCE_ARCHS do - find_arch_sources $arch '*.[chS]' + find_arch_sources $arch '*.[chS]' '*.rs' done - find_other_sources '*.[chS]' + find_other_sources '*.[chS]' '*.rs' } all_compiled_sources() -- 2.55.0