Linux-Firmware Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Emil Velikov via B4 Relay <devnull+emil.l.velikov.gmail.com@kernel.org>
To: linux-firmware@kernel.org
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Subject: [PATCH v2 02/16] check_whence.py: ban link-to-a-link
Date: Mon, 23 Sep 2024 14:09:30 +0100	[thread overview]
Message-ID: <20240923-misc-fixes-v2-2-397f23443628@gmail.com> (raw)
In-Reply-To: <20240923-misc-fixes-v2-0-397f23443628@gmail.com>

From: Emil Velikov <emil.l.velikov@gmail.com>

Using link-to-a-link reduces legibility and changes to the root link,
also changes the leafs. Where the latter may be undesired and in some
cases just wrong.

We have a couple of instances in-tree, so fix them up and ban the
combination.

One particularly good example, why we'd want this is:
https://gitlab.com/kernel-firmware/linux-firmware/-/merge_requests/272

In there we have the following:

    File: ti/tas2781/TAS2XXX1EB30.bin
    [snip]
    Link: TAS2XXX1EB3.bin -> ti/tas2781/TAS2XXX1EB3.bin
    Link: ti/tas2781/TAS2XXX1EB3.bin -> TAS2XXX1EB30.bin
    Link: TAS2XXX1EB30.bin -> ti/tas2781/TAS2XXX1EB30.bin

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 WHENCE          | 14 +++++++-------
 check_whence.py | 12 ++++++++++--
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/WHENCE b/WHENCE
index 3897121a115e185cc36e782b33ef66e43d87d557..6af1a97e2672922f2a3a1fcf0306b158eae1b6f7 100644
--- a/WHENCE
+++ b/WHENCE
@@ -3686,7 +3686,7 @@ File: ath10k/WCN3990/hw1.0/qcm2290/wlanmdsp.mbn
 Version: WLAN.HL.3.3.7.c2-00931-QCAHLSWMTPLZ-1
 Link: ath10k/WCN3990/hw1.0/qrb4210/wlanmdsp.mbn -> ../qcm2290/wlanmdsp.mbn
 Link: qcom/qcm2290/wlanmdsp.mbn -> ../../ath10k/WCN3990/hw1.0/qcm2290/wlanmdsp.mbn
-Link: qcom/qrb4210/wlanmdsp.mbn -> ../../ath10k/WCN3990/hw1.0/qrb4210/wlanmdsp.mbn
+Link: qcom/qrb4210/wlanmdsp.mbn -> ../../ath10k/WCN3990/hw1.0/qcm2290/wlanmdsp.mbn
 File: ath10k/WCN3990/hw1.0/qcm2290/firmware-5.bin
 Link: ath10k/WCN3990/hw1.0/qrb4210/firmware-5.bin -> ../qcm2290/firmware-5.bin
 
@@ -5214,11 +5214,11 @@ Link: nvidia/gp104/acr/bl.bin -> ../../gp102/acr/bl.bin
 Link: nvidia/gp104/acr/ucode_load.bin -> ../../gp102/acr/ucode_load.bin
 Link: nvidia/gp104/acr/ucode_unload.bin -> ../../gp102/acr/ucode_unload.bin
 Link: nvidia/gp104/acr/unload_bl.bin -> ../../gp102/acr/unload_bl.bin
-Link: nvidia/gp104/gr/fecs_bl.bin -> ../../gp102/gr/fecs_bl.bin
+Link: nvidia/gp104/gr/fecs_bl.bin -> ../../gm200/gr/fecs_bl.bin
 File: nvidia/gp104/gr/fecs_data.bin
 File: nvidia/gp104/gr/fecs_inst.bin
 File: nvidia/gp104/gr/fecs_sig.bin
-Link: nvidia/gp104/gr/gpccs_bl.bin -> ../../gp102/gr/gpccs_bl.bin
+Link: nvidia/gp104/gr/gpccs_bl.bin -> ../../gm200/gr/gpccs_bl.bin
 File: nvidia/gp104/gr/gpccs_data.bin
 File: nvidia/gp104/gr/gpccs_inst.bin
 File: nvidia/gp104/gr/gpccs_sig.bin
@@ -5237,11 +5237,11 @@ Link: nvidia/gp106/acr/bl.bin -> ../../gp102/acr/bl.bin
 Link: nvidia/gp106/acr/ucode_load.bin -> ../../gp102/acr/ucode_load.bin
 Link: nvidia/gp106/acr/ucode_unload.bin -> ../../gp102/acr/ucode_unload.bin
 Link: nvidia/gp106/acr/unload_bl.bin -> ../../gp102/acr/unload_bl.bin
-Link: nvidia/gp106/gr/fecs_bl.bin -> ../../gp102/gr/fecs_bl.bin
+Link: nvidia/gp106/gr/fecs_bl.bin -> ../../gm200/gr/fecs_bl.bin
 File: nvidia/gp106/gr/fecs_data.bin
 Link: nvidia/gp106/gr/fecs_inst.bin -> ../../gp102/gr/fecs_inst.bin
 File: nvidia/gp106/gr/fecs_sig.bin
-Link: nvidia/gp106/gr/gpccs_bl.bin -> ../../gp102/gr/gpccs_bl.bin
+Link: nvidia/gp106/gr/gpccs_bl.bin -> ../../gm200/gr/gpccs_bl.bin
 File: nvidia/gp106/gr/gpccs_data.bin
 Link: nvidia/gp106/gr/gpccs_inst.bin -> ../../gp102/gr/gpccs_inst.bin
 File: nvidia/gp106/gr/gpccs_sig.bin
@@ -5924,10 +5924,10 @@ File: netronome/flower/nic_AMDA0096.nffw
 File: netronome/flower/nic_AMDA0097.nffw
 File: netronome/flower/nic_AMDA0058.nffw
 Link: netronome/flower/nic_AMDA0081.nffw -> nic_AMDA0097.nffw
-Link: netronome/flower/nic_AMDA0081-0001_1x40.nffw -> nic_AMDA0081.nffw
+Link: netronome/flower/nic_AMDA0081-0001_1x40.nffw -> nic_AMDA0097.nffw
 Link: netronome/flower/nic_AMDA0097-0001_2x40.nffw -> nic_AMDA0097.nffw
 Link: netronome/flower/nic_AMDA0099-0001_2x10.nffw -> nic_AMDA0099.nffw
-Link: netronome/flower/nic_AMDA0081-0001_4x10.nffw -> nic_AMDA0081.nffw
+Link: netronome/flower/nic_AMDA0081-0001_4x10.nffw -> nic_AMDA0097.nffw
 Link: netronome/flower/nic_AMDA0097-0001_4x10_1x40.nffw -> nic_AMDA0097.nffw
 Link: netronome/flower/nic_AMDA0099-0001_2x25.nffw -> nic_AMDA0099.nffw
 Link: netronome/flower/nic_AMDA0096-0001_2x10.nffw -> nic_AMDA0096.nffw
diff --git a/check_whence.py b/check_whence.py
index c270ee6020083044645353235a94eee0b2497960..d7742f1ed951acab6efc89916c7f6621ba56881b 100755
--- a/check_whence.py
+++ b/check_whence.py
@@ -115,12 +115,20 @@ def main():
         sys.stderr.write("E: %s listed in WHENCE as Link, is in tree\n" % name)
         ret = 1
 
+    invalid_targets = set(link[0] for link in links_list)
+    for link, target in sorted(links_list):
+        if target in invalid_targets:
+            sys.stderr.write(
+                "E: target %s of link %s is also a link\n" % (target, link)
+            )
+            ret = 1
+
     for name in sorted(list(known_files - git_files)):
         sys.stderr.write("E: %s listed in WHENCE does not exist\n" % name)
         ret = 1
 
-    # A link can point to another link, or to a file...
-    valid_targets = set(link[0] for link in links_list) | git_files
+    # A link can point to a file...
+    valid_targets = set(git_files)
 
     # ... or to a directory
     for target in set(valid_targets):

-- 
2.46.1



  parent reply	other threads:[~2024-09-23 13:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23 13:09 [PATCH v2 00/16] Range of copy-firmware/check_whence fixes Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 01/16] check_whence.py: use consistent naming Emil Velikov via B4 Relay
2024-09-23 13:09 ` Emil Velikov via B4 Relay [this message]
2024-09-23 13:09 ` [PATCH v2 03/16] check_whence.py: LC_ALL=C sort -u the filelist Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 04/16] check_whence.py: annotate replacement strings as raw Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 05/16] editorconfig: add initial config file Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 06/16] Style update yaml files Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 07/16] copy-firmware.sh: flesh out and fix dedup-firmware.sh Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 08/16] Revert "copy-firmware: Support additional compressor options" Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 09/16] copy-firmware.sh: reset and consistently handle destdir Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 10/16] copy-firmware.sh: fix indentation Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 11/16] copy-firmware.sh: add err() helper Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 12/16] copy-firmware.sh: warn if the destination folder is not empty Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 13/16] copy-firmware.sh: call ./check_whence.py before parsing the file Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 14/16] copy-firmware.sh: remove no longer reachable test -f Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 15/16] copy-firmware.sh: remove no longer reachable test -L Emil Velikov via B4 Relay
2024-09-23 13:09 ` [PATCH v2 16/16] copy-firmware.sh: rename variables in symlink hanlding Emil Velikov via B4 Relay
2024-10-10  3:25 ` [PATCH v2 00/16] Range of copy-firmware/check_whence fixes Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240923-misc-fixes-v2-2-397f23443628@gmail.com \
    --to=devnull+emil.l.velikov.gmail.com@kernel.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=linux-firmware@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox