Skip to content

Commit 9d3faf2

Browse files
ij-intelbjorn-helgaas
authored andcommitted
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/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]>
1 parent 783602c commit 9d3faf2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/pci/quirks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* file, where their drivers can use them.
1313
*/
1414

15+
#include <linux/align.h>
1516
#include <linux/bitfield.h>
1617
#include <linux/types.h>
1718
#include <linux/kernel.h>
@@ -604,7 +605,7 @@ static void quirk_s3_64M(struct pci_dev *dev)
604605
{
605606
struct resource *r = &dev->resource[0];
606607

607-
if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) {
608+
if (!IS_ALIGNED(r->start, SZ_64M) || resource_size(r) != SZ_64M) {
608609
r->flags |= IORESOURCE_UNSET;
609610
resource_set_range(r, 0, SZ_64M);
610611
}

0 commit comments

Comments
 (0)