lib: logic_pio: Avoid possible overlap for unregistering regions
authorJohn Garry <john.garry@huawei.com>
Tue, 30 Jul 2019 13:29:53 +0000 (21:29 +0800)
committerWei Xu <xuwei5@hisilicon.com>
Tue, 13 Aug 2019 06:54:19 +0000 (14:54 +0800)
commit0a27142bd1ee259e24a0be2b0133e5ca5df8da91
treed72620fb516307f9d41ae0a44be406d2144bb5f2
parent06709e81c668f5f56c65b806895b278517bd44e0
lib: logic_pio: Avoid possible overlap for unregistering regions

The code was originally written to not support unregistering logical PIO
regions.

To accommodate supporting unregistering logical PIO regions, subtly modify
LOGIC_PIO_CPU_MMIO region registration code, such that the "end" of the
registered regions is the "end" of the last region, and not the sum of
the sizes of all the registered regions.

Cc: stable@vger.kernel.org
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
lib/logic_pio.c