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>] [day] [month] [year] [list]
Message-Id: <20221008081317.309193-1-ye.xingchen@zte.com.cn>
Date:   Sat,  8 Oct 2022 08:13:17 +0000
From:   yexingchen116@...il.com
To:     broonie@...nel.org
Cc:     lgirdwood@...il.com, linux-kernel@...r.kernel.org,
        ye xingchen <ye.xingchen@....com.cn>
Subject: [PATCH linux-next] regulator: gpio: replace !strcmp with sysfs_streq

From: ye xingchen <ye.xingchen@....com.cn>

Replace the open-code with sysfs_streq().

Signed-off-by: ye xingchen <ye.xingchen@....com.cn>
---
 drivers/regulator/gpio-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 95e61a2f43f5..9a5d6047ad81 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -211,9 +211,9 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
 	config->type = REGULATOR_VOLTAGE;
 	ret = of_property_read_string(np, "regulator-type", &regtype);
 	if (ret >= 0) {
-		if (!strncmp("voltage", regtype, 7))
+		if (sysfs_streq(regtype, "voltage"))
 			config->type = REGULATOR_VOLTAGE;
-		else if (!strncmp("current", regtype, 7))
+		else if (sysfs_streq(regtype, "current"))
 			config->type = REGULATOR_CURRENT;
 		else
 			dev_warn(dev, "Unknown regulator-type '%s'\n",
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ