resource/PCI: align functions now return start of resource
As suggested by Linus, align functions should return the start of a resource, not void. An update of "res->start" is no longer necessary. Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:

committed by
Jesse Barnes

szülő
93da620226
commit
b26b2d494b
@@ -254,10 +254,10 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
|
||||
* Since we are just checking candidates, don't use any fields other
|
||||
* than res->start.
|
||||
*/
|
||||
void pcibios_align_resource(void *data, struct resource *res,
|
||||
resource_size_t pcibios_align_resource(void *data, struct resource *res,
|
||||
resource_size_t size, resource_size_t alignment)
|
||||
{
|
||||
resource_size_t mask, align;
|
||||
resource_size_t mask, align, start = res->start;
|
||||
|
||||
DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n",
|
||||
pci_name(((struct pci_dev *) data)),
|
||||
@@ -269,10 +269,10 @@ void pcibios_align_resource(void *data, struct resource *res,
|
||||
|
||||
/* Align to largest of MIN or input size */
|
||||
mask = max(alignment, align) - 1;
|
||||
res->start += mask;
|
||||
res->start &= ~mask;
|
||||
start += mask;
|
||||
start &= ~mask;
|
||||
|
||||
/* The caller updates the end field, we don't. */
|
||||
return start;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user