linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiahui Cen <cenjiahui@huawei.com>
To: <linux-kernel@vger.kernel.org>
Cc: Wei Xu <xuwei5@hisilicon.com>, Arnd Bergmann <arnd@arndb.de>,
	John Garry <john.garry@huawei.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	<xieyingtai@huawei.com>, Jiahui Cen <cenjiahui@huawei.com>
Subject: [PATCH] lib/logic_pio: Fix overlap check for pio registery
Date: Fri, 18 Dec 2020 14:23:35 +0800	[thread overview]
Message-ID: <20201218062335.5320-1-cenjiahui@huawei.com> (raw)

Since the [start, end) is a half-open interval, a range with the end equal
to the start of another range should not be considered as overlapped.

Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
---
 lib/logic_pio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/logic_pio.c b/lib/logic_pio.c
index f32fe481b492..445d611f1dc1 100644
--- a/lib/logic_pio.c
+++ b/lib/logic_pio.c
@@ -57,7 +57,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range)
 		    new_range->flags == LOGIC_PIO_CPU_MMIO) {
 			/* for MMIO ranges we need to check for overlap */
 			if (start >= range->hw_start + range->size ||
-			    end < range->hw_start) {
+			    end <= range->hw_start) {
 				mmio_end = range->io_start + range->size;
 			} else {
 				ret = -EFAULT;
-- 
2.28.0


             reply	other threads:[~2020-12-18  6:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18  6:23 Jiahui Cen [this message]
2020-12-18 10:40 ` John Garry
2020-12-21  3:24   ` Jiahui Cen
2020-12-21 11:12     ` John Garry
2020-12-21 13:04       ` Jiahui Cen
2021-01-15 10:10         ` John Garry
2021-01-18  1:27           ` Jiahui Cen
2021-03-15 10:30             ` John Garry

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=20201218062335.5320-1-cenjiahui@huawei.com \
    --to=cenjiahui@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xieyingtai@huawei.com \
    --cc=xuwei5@hisilicon.com \
    --subject='Re: [PATCH] lib/logic_pio: Fix overlap check for pio registery' \
    /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

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).