[PATCH] mmc: atmel-mci: Remove preprocessor directive

Balamanikandan Gunasundar balamanikandan.gunasundar at microchip.com
Mon Aug 28 03:04:21 PDT 2023


Remove the preprocessor directive IS_ENABLED(CONFIG_MMC_ATMELMCI) while
checking if the device is compatible with atmel,hsmci. Instead handle it in
the if() condition. The compiler optimizes out the entire if() clause if
the first expression in the if() clause is constant false.

Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar at microchip.com>
Suggested-by: Linus Walleij <linus.walleij at linaro.org>
---
 drivers/gpio/gpiolib-of.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 9694eb5afa21..9a191940d5af 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -262,16 +262,15 @@ static void of_gpio_set_polarity_by_property(const struct device_node *np,
 	unsigned int i;
 	bool active_high;
 
-#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
 	/*
 	 * The Atmel HSMCI has compatible property in the parent node and
 	 * gpio property in a child node
 	 */
-	if (of_device_is_compatible(np->parent, "atmel,hsmci")) {
+	if (IS_ENABLED(CONFIG_MMC_ATMELMCI) &&
+	    of_device_is_compatible(np->parent, "atmel,hsmci")) {
 		np_compat = np->parent;
 		np_propname = np;
 	}
-#endif
 
 	for (i = 0; i < ARRAY_SIZE(gpios); i++) {
 		if (of_device_is_compatible(np_compat, gpios[i].compatible) &&
-- 
2.25.1




More information about the linux-arm-kernel mailing list