[Pkg-pciutils-discuss] Re: [PATCH] Restore lspci -m formatting on machines with domains

Matthew Wilcox matthew at wil.cx
Tue Apr 11 14:26:26 UTC 2006


On Tue, Mar 21, 2006 at 11:49:45PM +0100, Martin Mares wrote:
> @@ -243,7 +243,7 @@
>  {
>    struct pci_dev *p = d->dev;
>  
> -  if (show_domains)
> +  if (!machine_readable ? show_domains : (p->domain || show_domains >= 2))
>      printf("%04x:", p->domain);

Actually, that can be simplified to:

    if (p->domain || (show_domains - machine_readable) > 0)
      printf("%04x:", p->domain);

if you also change the case 'm' to set to 1 rather than increment.

>    printf("%02x:%02x.%d", p->bus, p->dev, p->func);
>  }
> @@ -2322,7 +2322,7 @@
>  	map_mode++;
>  	break;
>        case 'D':
> -	show_domains = 1;
> +	show_domains = 2;
>  	break;
>        default:
>  	if (parse_generic_option(i, pacc, optarg))



More information about the Pkg-pciutils-discuss mailing list