lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230828100421.19758-1-balamanikandan.gunasundar@microchip.com>
Date:   Mon, 28 Aug 2023 15:34:21 +0530
From:   Balamanikandan Gunasundar 
        <balamanikandan.gunasundar@...rochip.com>
To:     <linus.walleij@...aro.org>, <dmitry.torokhov@...il.com>,
        <ulf.hansson@...aro.org>, <linux-kernel@...r.kernel.org>,
        <linux-mmc@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <ludovic.desroches@...rochip.com>, <nicolas.ferre@...rochip.com>,
        <alexandre.belloni@...tlin.com>
CC:     <hari.prasathge@...rochip.com>,
        <balamanikandan.gunasundar@...rochip.com>
Subject: [PATCH] mmc: atmel-mci: Remove preprocessor directive

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@...rochip.com>
Suggested-by: Linus Walleij <linus.walleij@...aro.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ