Skip to content

Commit

Permalink
make all fields work with :
Browse files Browse the repository at this point in the history
  • Loading branch information
HikariKnight committed Apr 8, 2023
1 parent 1e41609 commit a2f4e2a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/iommu/genoutput.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func GenDeviceLine(group int, device *pci.Device, pArg *params.Params) string {
switch object {
case "pciaddr":
formated_line = append(formated_line, device.Address)
case "pciaddr:":
formated_line = append(formated_line, fmt.Sprintf("%s:", device.Address))
case "subclass_name":
formated_line = append(formated_line, device.Subclass.Name)
case "subclass_name:":
Expand Down Expand Up @@ -63,11 +65,20 @@ func GenDeviceLine(group int, device *pci.Device, pArg *params.Params) string {
formated_line = append(formated_line, fmt.Sprintf("[%s:%s]:", device.Vendor.ID, device.Product.ID))
case "revision":
formated_line = append(formated_line, fmt.Sprintf("(rev %s)", device.Revision[len(device.Revision)-2:]))
case "revision:":
formated_line = append(formated_line, fmt.Sprintf("(rev %s):", device.Revision[len(device.Revision)-2:]))
case "optional_revision":
// Else only show it if the device is not on revision 00
if device.Revision != "0x00" {
formated_line = append(formated_line, fmt.Sprintf("(rev %s)", device.Revision[len(device.Revision)-2:]))
}
case "optional_revision:":
// Else only show it if the device is not on revision 00
if device.Revision != "0x00" {
formated_line = append(formated_line, fmt.Sprintf("(rev %s):", device.Revision[len(device.Revision)-2:]))
} else {
formated_line = append(formated_line, ":")
}
}
}

Expand Down

0 comments on commit a2f4e2a

Please sign in to comment.