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]
Date:   Tue, 21 Feb 2023 10:36:34 +0800
From:   Yang Li <yang.lee@...ux.alibaba.com>
To:     damien.lemoal@...nsource.wdc.com
Cc:     s.shtylyov@....ru, linux-ide@...r.kernel.org,
        linux-kernel@...r.kernel.org, Yang Li <yang.lee@...ux.alibaba.com>
Subject: [PATCH -next] ata: pata_macio: Use of_property_present() helper

Use of_property_present() instead of of_get_property/of_find_property()
in places where we just need to test presence of a property.

Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
---
 drivers/ata/pata_macio.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index 9ccaac9e2bc3..f698d77e87e1 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -479,10 +479,9 @@ static int pata_macio_cable_detect(struct ata_port *ap)
 	    priv->kind == controller_un_ata6 ||
 	    priv->kind == controller_k2_ata6 ||
 	    priv->kind == controller_sh_ata6) {
-		const char* cable = of_get_property(priv->node, "cable-type",
-						    NULL);
+		const char *cable = of_property_present(priv->node, "cable-type");
 		struct device_node *root = of_find_node_by_path("/");
-		const char *model = of_get_property(root, "model", NULL);
+		const char *model = of_property_present(root, "model");
 
 		of_node_put(root);
 
@@ -973,7 +972,7 @@ static void pata_macio_invariants(struct pata_macio_priv *priv)
 	/* XXX FIXME --- setup priv->mediabay here */
 
 	/* Get Apple bus ID (for clock and ASIC control) */
-	bidp = of_get_property(priv->node, "AAPL,bus-id", NULL);
+	bidp = of_property_present(priv->node, "AAPL,bus-id");
 	priv->aapl_bus_id =  bidp ? *bidp : 0;
 
 	/* Fixup missing Apple bus ID in case of media-bay */
-- 
2.20.1.7.g153144c

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ