linux-mips
[Top] [All Lists]

[PATCH] ssb: gpio: use #if instead of "if" for IS_ENABLED

To: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH] ssb: gpio: use #if instead of "if" for IS_ENABLED
From: Rafał Miłecki <zajec5@gmail.com>
Date: Tue, 14 Jan 2014 15:23:29 +0100
Cc: Hauke Mehrtens <hauke@hauke-m.de>, Michael Buesch <m@bues.ch>, Rafał Miłecki <zajec5@gmail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=bE7WPN/C9nNa8r+2f6+Nf+pXVVQ9c2usCPq66kxg9xs=; b=dWcyaP+aSL0k1WTYuN9XbB1O3DAj+mVxEoc/8hogU08oUyoy240s1AObB9iro7719Z BdtX8WPixeQ+jJE7uVp+ASnw1Kd8hb2/+vbBkHtOwFbzyM2O+4y9YnA5ux9yGWPiJeo1 bLlg+ntR+k9gpWufLs0Y+XO3mU8ORme09/F+VjbmKVcCYiLmFM1F/fVAJl2Lm1uLePtv ez8kOHvOM9qZekZzkkSqCo0IygxQO7l6eZ8DwtAr1fnA4cWOWZnEsARuwaOZrTUpDbma UOaK/edbVnzgmZHf7g6vvuRg8Vkkegei3Kuwd0qWGhqJJzzzADi4YScVLGzfXns9gRDD itUw==
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Standard "if" was evaluating to if (0) which still required conditional
code to be correct. It is not, as ssb_gpio_to_irq is not defined.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
John: if you manage to, you should merge (bundle?) this one with
ssb: gpio: add own IRQ domain
(to avoid build breakage during bisection)
---
 drivers/ssb/driver_gpio.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/ssb/driver_gpio.c b/drivers/ssb/driver_gpio.c
index 6c5a97d..ba350d2 100644
--- a/drivers/ssb/driver_gpio.c
+++ b/drivers/ssb/driver_gpio.c
@@ -230,8 +230,9 @@ static int ssb_gpio_chipco_init(struct ssb_bus *bus)
        chip->set               = ssb_gpio_chipco_set_value;
        chip->direction_input   = ssb_gpio_chipco_direction_input;
        chip->direction_output  = ssb_gpio_chipco_direction_output;
-       if (IS_ENABLED(CONFIG_SSB_EMBEDDED))
-               chip->to_irq    = ssb_gpio_to_irq;
+#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
+       chip->to_irq            = ssb_gpio_to_irq;
+#endif
        chip->ngpio             = 16;
        /* There is just one SoC in one device and its GPIO addresses should be
         * deterministic to address them more easily. The other buses could get
@@ -422,8 +423,9 @@ static int ssb_gpio_extif_init(struct ssb_bus *bus)
        chip->set               = ssb_gpio_extif_set_value;
        chip->direction_input   = ssb_gpio_extif_direction_input;
        chip->direction_output  = ssb_gpio_extif_direction_output;
-       if (IS_ENABLED(CONFIG_SSB_EMBEDDED))
-               chip->to_irq    = ssb_gpio_to_irq;
+#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
+       chip->to_irq            = ssb_gpio_to_irq;
+#endif
        chip->ngpio             = 5;
        /* There is just one SoC in one device and its GPIO addresses should be
         * deterministic to address them more easily. The other buses could get
-- 
1.7.10.4


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] ssb: gpio: use #if instead of "if" for IS_ENABLED, Rafał Miłecki <=