RE: [PATCH 06/16] x86/amd_nb: Simplify root device search

Zhuo, Qiuxu
2024-10-31T07:52:23Z

> From: Yazen Ghannam <yazen.ghannam@amd.com>
> [...]
> +struct pci_dev *amd_node_get_root(u16 node) {
> + struct pci_dev *df_f0 __free(pci_dev_put) = NULL;

NULL pointer initialization is not necessary.

> + struct pci_dev *root;
> + u16 cntl_off;
> + u8 bus;
> +
> + if (!boot_cpu_has(X86_FEATURE_ZEN))
> + return NULL;
> +
> + /*
> + * D18F0xXXX [Config Address Control] (DF::CfgAddressCntl)
> + * Bits [7:0] (SecBusNum) holds the bus number of the root device for
> + * this Data Fabric instance. The segment, device, and function will be
> 0.
> + */
> + df_f0 = amd_node_get_func(node, 0);
> + if (!df_f0)
> + return NULL;
> …