[PATCH] umr: Completion: Fix regex for PCI bus names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix regex for PCI bus names. Previously we may see something like this:
   0000:0b:00.0 master=pci:0000:0b:00.0
while the correct output should be this:
   0000:0b:00.0
This commit fixes the regex to do just this.

Cc: Tom StDenis <tom.stdenis@xxxxxxx>
Signed-off-by: Luben Tuikov <luben.tuikov@xxxxxxx>
---
 scripts/umr-completion.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/umr-completion.bash b/scripts/umr-completion.bash
index bd0b61b2d38831..0b8beab97b9aec 100644
--- a/scripts/umr-completion.bash
+++ b/scripts/umr-completion.bash
@@ -128,10 +128,10 @@ _umr_comp_gpu()
     for F in ${INSTANCE[*]} ; do
 	PCI_BUS_DIR_NAMES+=("/sys/kernel/debug/dri/$F/name")
     done
-    PCI_BUS_IDS=( `sudo cat ${PCI_BUS_DIR_NAMES[*]} | sed -E -e 's/^.* (dev=(.*)) .*$/\2/g' | sort | uniq` )
+    PCI_BUS_IDS=( `sudo cat ${PCI_BUS_DIR_NAMES[*]} | sed -E -e 's/^.* (dev=([:.[:xdigit:]]+)) .*$/\2/g' | sort | uniq` )
 
     for F in ${INSTANCE[*]} ; do
-	local PCI_ID=`sudo cat  "/sys/kernel/debug/dri/$F/name" | sed -E -e 's/^.* (dev=(.*)) .*$/\2/g'`
+	local PCI_ID=`sudo cat  "/sys/kernel/debug/dri/$F/name" | sed -E -e 's/^.* (dev=([:.[:xdigit:]]+)) .*$/\2/g'`
 	local DEV_ID=`cat /sys/class/pci_bus/${PCI_ID%:??.?}/device/$PCI_ID/device`
 	local DEV_ID_NAME=`grep -i $DEV_ID ${UMR_DATABASE_PATH}/pci.did | awk '{ print $2; }' | sed -E -e 's/.asic//g'`
 	TEMP_ASIC_NAMES+=($DEV_ID_NAME)

base-commit: 513ea1dc11b4c0fd0c94910bf09dd84517febcae
-- 
2.35.1.291.gdab1b7905d




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux