Re: [PATCH 2/4] PCI: Add pci_rebar_bytes_to_size()

2021-01-07 Thread Darren Salt
I demand that Bjorn Helgaas may or may not have written... >> +static inline int pci_rebar_bytes_to_size(u64 bytes) >> +{ >> +bytes = roundup_pow_of_two(bytes); >> +return max(ilog2(bytes), 20) - 20; > This isn't returning a "size", is it? It looks like it's returning the > log2 of the n

Re: [PATCH 2/4] PCI: Add pci_rebar_bytes_to_size()

2021-01-07 Thread Bjorn Helgaas
On Thu, Jan 07, 2021 at 11:31:36PM +, Darren Salt wrote: > I demand that Bjorn Helgaas may or may not have written... ? > >> +static inline int pci_rebar_bytes_to_size(u64 bytes) > >> +{ > >> + bytes = roundup_pow_of_two(bytes); > >> + return max(ilog2(bytes), 20) - 20; > > > This isn't re

Re: [PATCH 2/4] PCI: Add pci_rebar_bytes_to_size()

2021-01-07 Thread Bjorn Helgaas
On Thu, Jan 07, 2021 at 06:50:15PM +0100, Nirmoy Das wrote: > Users of pci_resize_resource() need a way to calculate bar size > from desired bytes. Add a helper function and export it so that > modular drivers can use it. s/bar/BAR/ > Signed-off-by: Darren Salt > Signed-off-by: Christian König

[PATCH 2/4] PCI: Add pci_rebar_bytes_to_size()

2021-01-07 Thread Nirmoy Das
Users of pci_resize_resource() need a way to calculate bar size from desired bytes. Add a helper function and export it so that modular drivers can use it. Signed-off-by: Darren Salt Signed-off-by: Christian König Signed-off-by: Nirmoy Das --- drivers/pci/pci.c | 2 +- include/linux/pci.h |