linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/logic_pio: Fix overlap check for pio registery
@ 2020-12-18  6:23 Jiahui Cen
  2020-12-18 10:40 ` John Garry
  0 siblings, 1 reply; 8+ messages in thread
From: Jiahui Cen @ 2020-12-18  6:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Wei Xu, Arnd Bergmann, John Garry, Bjorn Helgaas,
	Andy Shevchenko, xieyingtai, Jiahui Cen

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-15 10:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18  6:23 [PATCH] lib/logic_pio: Fix overlap check for pio registery Jiahui Cen
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

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