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

PCI: Use align and resource helpers, and SZ_* in quirk_s3_64M()

Use IS_ALIGNED(), resource_size(), and SZ_* defines in quirk_s3_64M().

Link: https://lore.kernel.org/r/20240614100606.15830-4-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Ilpo Järvinen and committed by
Bjorn Helgaas
9d3faf22 783602c9

+2 -1
+2 -1
drivers/pci/quirks.c
··· 12 12 * file, where their drivers can use them. 13 13 */ 14 14 15 + #include <linux/align.h> 15 16 #include <linux/bitfield.h> 16 17 #include <linux/types.h> 17 18 #include <linux/kernel.h> ··· 605 604 { 606 605 struct resource *r = &dev->resource[0]; 607 606 608 - if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) { 607 + if (!IS_ALIGNED(r->start, SZ_64M) || resource_size(r) != SZ_64M) { 609 608 r->flags |= IORESOURCE_UNSET; 610 609 resource_set_range(r, 0, SZ_64M); 611 610 }