Hi Ilpo,
> +/**
> + * pci_rebar_size_supported - check if size is supported for BAR
> + * @pdev: PCI device
> + * @bar: BAR to check
> + * @size: size as defined in the PCIe spec (0=1MB, 31=128TB)
> + *
> + * Return: %true if @bar is resizable and @size is a supported, otherwise
> + * %false.
> + */
> +bool pci_rebar_size_supported(struct pci_dev *pdev, int bar, int size)
> +{
> + u64 sizes = pci_rebar_get_possible_sizes(pdev, bar);
> +
> + return BIT(size) & sizes;
I would return here "!!(BIT(size) & sizes)", but it doesn't
really matter.
Reviewed-by: Andi Shyti <[email protected]>
Andi