bus: uniphier-system-bus: fix condition of overlap check
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Fri, 1 Apr 2016 10:32:43 +0000 (19:32 +0900)
committerOlof Johansson <olof@lixom.net>
Tue, 12 Apr 2016 19:31:50 +0000 (12:31 -0700)
This patch fixes condition whether the specified address ranges
overlap each other.

Fixes: 4b7f48d395a7 ("bus: uniphier-system-bus: add UniPhier System Bus driver")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
drivers/bus/uniphier-system-bus.c

index 834a2aeaf27a8d80b9dd1df110473dcab4ef154b..350b7309c26d714c1a80c2a56b2a2d9acf1040bb 100644 (file)
@@ -108,7 +108,7 @@ static int uniphier_system_bus_check_overlap(
 
        for (i = 0; i < ARRAY_SIZE(priv->bank); i++) {
                for (j = i + 1; j < ARRAY_SIZE(priv->bank); j++) {
-                       if (priv->bank[i].end > priv->bank[j].base ||
+                       if (priv->bank[i].end > priv->bank[j].base &&
                            priv->bank[i].base < priv->bank[j].end) {
                                dev_err(priv->dev,
                                        "region overlap between bank%d and bank%d\n",