From: Ilpo Järvinen Date: Fri, 14 Jun 2024 10:06:05 +0000 (+0300) Subject: PCI: Use align and resource helpers, and SZ_* in quirk_s3_64M() X-Git-Tag: v6.13-rc1~8^2~19^2~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9d3faf229c06d953999e2aa6b6dbb57afd252f26;p=linux-block.git 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 Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron --- diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index e25476a766a7..e85b89ca5601 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -12,6 +12,7 @@ * file, where their drivers can use them. */ +#include #include #include #include @@ -604,7 +605,7 @@ static void quirk_s3_64M(struct pci_dev *dev) { struct resource *r = &dev->resource[0]; - if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) { + if (!IS_ALIGNED(r->start, SZ_64M) || resource_size(r) != SZ_64M) { r->flags |= IORESOURCE_UNSET; resource_set_range(r, 0, SZ_64M); }