Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

parisc/PCI: Clean up align handling

Caller of pcibios_align_resource() (__find_resource_space()) already aligns
the start address by 'alignment' so aligning is only necessary if align >
alignment.

Change also to use ALIGN() instead of open-coding.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260324165633.4583-8-ilpo.jarvinen@linux.intel.com

authored by

Ilpo Järvinen and committed by
Bjorn Helgaas
38ec53e1 3fa40d30

+4 -6
+4 -6
arch/parisc/kernel/pci.c
··· 8 8 * Copyright (C) 1999-2001 Hewlett-Packard Company 9 9 * Copyright (C) 1999-2001 Grant Grundler 10 10 */ 11 + #include <linux/align.h> 11 12 #include <linux/eisa.h> 12 13 #include <linux/init.h> 13 14 #include <linux/module.h> ··· 201 200 resource_size_t size, 202 201 resource_size_t alignment) 203 202 { 204 - resource_size_t mask, align, start = res->start; 203 + resource_size_t align, start = res->start; 205 204 206 205 DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", 207 206 pci_name(((struct pci_dev *) data)), ··· 210 209 211 210 /* If it's not IO, then it's gotta be MEM */ 212 211 align = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM; 213 - 214 - /* Align to largest of MIN or input size */ 215 - mask = max(alignment, align) - 1; 216 - start += mask; 217 - start &= ~mask; 212 + if (align > alignment) 213 + start = ALIGN(start, align); 218 214 219 215 return start; 220 216 }