linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-pci@vger.kernel.org, "Bjorn Helgaas" <bhelgaas@google.com>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	"Philipp Stanner" <pstanner@redhat.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	linux-kernel@vger.kernel.org
Cc: "Jonathan Hunter" <jonathanh@nvidia.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-tegra@vger.kernel.org, "Robert Richter" <rric@kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH v2 3/4] PCI: Use align and resource helpers, and SZ_* in quirk_s3_64M()
Date: Fri, 14 Jun 2024 13:06:05 +0300	[thread overview]
Message-ID: <20240614100606.15830-4-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20240614100606.15830-1-ilpo.jarvinen@linux.intel.com>

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

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/pci/quirks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index bde0f5388d06..125fc1cbad95 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -12,6 +12,7 @@
  * file, where their drivers can use them.
  */
 
+#include <linux/align.h>
 #include <linux/bitfield.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -591,7 +592,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);
 	}
-- 
2.39.2



  parent reply	other threads:[~2024-06-14 11:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 10:06 [PATCH v2 0/4] PCI: Resource helper improvements Ilpo Järvinen
2024-06-14 10:06 ` [PATCH v2 1/4] resource: Add resource set range and size helpers Ilpo Järvinen
2024-06-14 10:06 ` [PATCH v2 2/4] PCI: Use resource_set_{range,size}() helpers Ilpo Järvinen
2024-06-14 10:06 ` Ilpo Järvinen [this message]
2024-06-14 10:06 ` [PATCH v2 4/4] PCI: Introduce ALIGN_DOWN_IF_NONZERO() helper locally Ilpo Järvinen
2024-06-14 13:20   ` Jonathan Cameron
2024-10-10 22:48 ` [PATCH v2 0/4] PCI: Resource helper improvements Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240614100606.15830-4-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=jonathanh@nvidia.com \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=pstanner@redhat.com \
    --cc=robh@kernel.org \
    --cc=rric@kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).