[PATCH v2] tty/hvc_opal: simplify if-if to if-else

Wan Jiabing wanjiabing at vivo.com
Tue Apr 26 17:10:41 AEST 2022


Use if and else instead of if(A) and if (!A).

Signed-off-by: Wan Jiabing <wanjiabing at vivo.com>
---
Change log:
v2:
- add braces to the if block.
---
 drivers/tty/hvc/hvc_opal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index 84776bc641e6..794c7b18aa06 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -342,9 +342,9 @@ void __init hvc_opal_init_early(void)
 		 * path, so we hard wire it
 		 */
 		opal = of_find_node_by_path("/ibm,opal/consoles");
-		if (opal)
+		if (opal) {
 			pr_devel("hvc_opal: Found consoles in new location\n");
-		if (!opal) {
+		} else {
 			opal = of_find_node_by_path("/ibm,opal");
 			if (opal)
 				pr_devel("hvc_opal: "
-- 
2.35.1



More information about the Linuxppc-dev mailing list