Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2746567pxb; Mon, 25 Apr 2022 01:12:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYKeK5t5FwMkR5/JjV88WIZ7tVS/bhm7SbsRhS6VCIZtQ18BClWJuLBglIgRbV7Sy0ci6W X-Received: by 2002:a63:6ac3:0:b0:3aa:f5a8:2e83 with SMTP id f186-20020a636ac3000000b003aaf5a82e83mr9272049pgc.232.1650874346870; Mon, 25 Apr 2022 01:12:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650874346; cv=pass; d=google.com; s=arc-20160816; b=UiRJ7YjGisq9Fl2WSHg5F642ZwCeunms5GT48sxnes3lCi6r+BHYZpvnK7xxoPbE9N R202W2Je9rWin8huuiSbmkqIajyV2CKRYQYzVsdK5T2BxzrWyjAbrNBz5KooiEzR8bPD JPlQvkoQSEoVQxxnGhsDHvDRyj4xkDOF2k0RZVgBwPWH5Cf28jE6Gq8EEJkXB5p5zc5f ecvmxIStnGNfbzcUyXDZLIN7Bt2iLrOyJ1ir6F23rL++9kGUEkHojoj+i0CRT7/JL7Tx p1PyzEkA531a7+M5J5W19byDyjtMM3y60/Rt7J9/zf4IAg1BrN4b9J3h5VSwmykUOxHD yrNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=qQOUK/Ne0UkX/FzbxTbNENOBpVva+p93KRg87jkCfIo=; b=eqpXgv43YI9Z2/UprwL70H3ffQeskrHhBw8st45q7le4AyszvclUIZaWRX9W/Jp9c0 JtI0ByI/+kNxutIuItNHFk+UIuH2rW56fSmlikMIvd0DWZ2jKjY/CAA2fCHNXtNM95/c 37VBRwKcn6QOEgl1MGWDq1KySYs2lLVYd7DR5FPQ7876TCsuM6KAOFD3bDKPF09mgtAW BVMp9+6lzt9GJ1vMaFMaJoK8WsOIskAG0qiIDI8wy/CI6+lW5P9ftXkzyUyY4ZIsHoPm lFflAQlTabyExVWO7Sp7EHMMzlvfQLg5dN9BpMyiYl3UD8aOoTF7Zpzh56HbQS7ZjbUg oMhA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=R8OyXbN8; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h70-20020a638349000000b003ab3da7b5aasi2625562pge.389.2022.04.25.01.12.13; Mon, 25 Apr 2022 01:12:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=R8OyXbN8; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238811AbiDXJ2d (ORCPT + 99 others); Sun, 24 Apr 2022 05:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbiDXJ2a (ORCPT ); Sun, 24 Apr 2022 05:28:30 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2120.outbound.protection.outlook.com [40.107.215.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 384E7E90 for ; Sun, 24 Apr 2022 02:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HFmjDSvasYP9B4fmSnQCIiRnb08W9+11GwlIzkUG6+eDyQX8C5ed3lMeDG3eq4JbDAWhPik5qPZ1j/ujggosfHeymvRJZH+BBxbfQQ7cIUuqQqFm1hAqwXFo2kclKijmiVgpSi67d67ZxTdFOZtSQ84UFwO4Iws4z+lGu+mHkKRGuEdWRZQSO9EKR16GnCRzAyZ/B7Opw8PZy4DQ1oFkb2pnhsB/lL86WsnEOnQ7P5gFfbH+vWelwNyC4hP9QNfge0mRflO/5pIEwCbe2OfaWmNaFS+SguhGvD1FCFNAckfAQ2IL/hY5nWWa/UIHFLY1arvhuphIh3UpRC8zePikpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qQOUK/Ne0UkX/FzbxTbNENOBpVva+p93KRg87jkCfIo=; b=BceeF8Pwh7j4B21RYrlw8FpxoriOcSLDVQ8lz+MRuNFeutUqZgWogeNjEk3I9/ifs3Kg0UwJlztSdhuTdDmiB0Zbu7KXuzNaif4Vh2L05G11nClajVScM5qjoyVfgl7rolMyzS+aLzl3mIZUL7MvKLDKuUY2J0Ylkl+saCnU/B6/DLVb44ht8nzRKV+0grzEuLdMvlTxxOW/YGlyXqwVIpGjgYCk/yI5WfA81xe3LqO8IgDrTIYOAPNM4frdReNOTZ3fbiaHe35SADYi4qXIK3xGfOyFUgD0AmHOYpFRvklb8iUw/oYS6/xBAVMjie2rBFd5CytaxkVveZjecAHOjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qQOUK/Ne0UkX/FzbxTbNENOBpVva+p93KRg87jkCfIo=; b=R8OyXbN8aPwws1aVF8qSBxHAM3v16R8V+46CVmCBv4m5awxEqqzwVuPBStKFii6DfYrx1pmSdyWH22m4kndUjEI9Ts6ZdMNRKlAzgE/r1Nu+Y2stfmvbfj37S6a6mrb2c9f6/y2EWIt1BguPm8WmW0D+8pEPhW/wEDLRoTwR4YQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB3367.apcprd06.prod.outlook.com (2603:1096:4:78::19) by SL2PR06MB3241.apcprd06.prod.outlook.com (2603:1096:100:3d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13; Sun, 24 Apr 2022 09:25:24 +0000 Received: from SG2PR06MB3367.apcprd06.prod.outlook.com ([fe80::4591:4f3e:f951:6c8c]) by SG2PR06MB3367.apcprd06.prod.outlook.com ([fe80::4591:4f3e:f951:6c8c%7]) with mapi id 15.20.5186.019; Sun, 24 Apr 2022 09:25:23 +0000 From: Wan Jiabing To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Greg Kroah-Hartman , Jiri Slaby , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: kael_w@yeah.net, Wan Jiabing Subject: [PATCH] tty/hvc_opal: simplify if-if to if-else Date: Sun, 24 Apr 2022 17:25:11 +0800 Message-Id: <20220424092511.100309-1-wanjiabing@vivo.com> X-Mailer: git-send-email 2.35.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: HK2PR04CA0078.apcprd04.prod.outlook.com (2603:1096:202:15::22) To SG2PR06MB3367.apcprd06.prod.outlook.com (2603:1096:4:78::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ab21901b-caaa-48d7-babe-08da25d45be6 X-MS-TrafficTypeDiagnostic: SL2PR06MB3241:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UeiPmwfQwNM1LsHmOMDSRBEQE5vH4XFAFDgyntyRrx3T2WMcZcGKEXXiIiPyUukFMgZeHawu51I1DklV4j6o68WyVfv1epzUS5ldXRH51hs7nKQ+sLbtVOJ7Yy+gFkckjGqWiG+6VTVWOoHyo6RQW5JJWwkQl/JXG844UvZGgys8wC6gCrmjqMlGaj2zkE0a/kh9b8RArKFiTy2bVUnzw2xH5gXBvSV1D2vNJvvoMG9eKBI92VQsZmsXgd+Y3kJyYkB/TnLQQoPwNXAPEAanpwMlvQPmisEtbK1gElfy8Id1nlcsLbemXqyOo0mwmqpUbAHO35k0MRhn5bAIUTnjjxUhnVwU8Jc/dnqZfHN2/lAxaVkU7IafYcbHtuAUZlz+EVZUYh34c3Lg/79WkWg9753K7ttxKMxApWxXWiUAuJ3mEz8+uVenSp0/Nlrre8vlrXPlmWQp9vbsL4wXksjGNXe5jiAaRx52YA/KsyWyhAHLyczExSql5QvK1Tmemre60Dtb2wYOkBFvkVhcYhG9qg3uYuKfYvgrjojg9jDe5eysM0LVlbcEv+MDtUP4QsADGffOFdy0V3DDKs4jbqRh8rKhEdB8I7GGfCgYoIi3pC1qd/WP7E35ctmgMQYCMP7zkYOwPD0PNVLc6SHo82r1b8+bKwsvu3TmkHGjtOzZbEUouZezHLDK2QkJbaeW6n9LjSRKrHaxjWTb/uwC7CD1Nw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR06MB3367.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(4744005)(1076003)(8936002)(86362001)(5660300002)(66946007)(66556008)(66476007)(38350700002)(38100700002)(6512007)(26005)(6666004)(6506007)(4326008)(8676002)(2616005)(52116002)(2906002)(107886003)(186003)(316002)(83380400001)(6486002)(508600001)(110136005)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LJURF6oGKcGyNIBd/QwA7BbNUj4y7PrRrfFgKGg1rERj1bIm1VKjPbx6g5Jx?= =?us-ascii?Q?xqvSf/9Pjeuml8nuOh8f2U4EbgkbJrby0SiivcvIj8z6HwLnfXSZQH6k4NM4?= =?us-ascii?Q?RLDUvXvwE0qFOjyiNJ6rhr4WxK2VZNmCJXHdFCXtfKEG8UtDb+onV4b0oTur?= =?us-ascii?Q?idRngf5A0M6bQqnxptnpYB2XK8bQ5Vu31LawUcK2vp0q++6VfK0vv2bCscAG?= =?us-ascii?Q?s7wCuvhMHoKzqkWtpKNhra809+3CbKrwgtYZRkNexCMI+9Ikb5pCxOcIb2Rs?= =?us-ascii?Q?cZphvVou1frj5hiPbSpR53I4wBXH0ypZpfdXolrwBPx433SbqdJGZBFj21iA?= =?us-ascii?Q?Rv2XmqE0OTIfvM5DeaPJ6rX8JkHvyaRMUllpbZsdRZW/avBCJF1vQXlS3h1C?= =?us-ascii?Q?WxR3waU51pOj+0xaxieuV2tRb3P6EneJlhDTbYXeKpELCwlgwu9UkvnFC4fr?= =?us-ascii?Q?J5cSDoZZCD7eohss2kStnGUkQl8rPBcMkQyVLDUtL3XTWQdm/OP9JdvyNCxo?= =?us-ascii?Q?o1P6Dt/Xwax/GdH4tgGq/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= =?us-ascii?Q?4dNSEjDL+PQdQsS1OWuqZHTZGMJS+cf4xMYa/iiNptC5cSknF4SrR8s5YtLp?= =?us-ascii?Q?99k0HpikglCu8+xW++uu9gtjQwCY6cY0LDD59JOXqv06VSlSM1AmZb0rPzmz?= =?us-ascii?Q?RLLV/noYV5Oi9NykmNew1yr7AHvcse0ieo73RcovI8Cb8z2QKwkqWwXkrbox?= =?us-ascii?Q?lXqRs4GonQqJVisaElGcHhJutRWARqFwAiLE9dGxXMoKlED0qSTSsBWp4t16?= =?us-ascii?Q?ryFssWNvdVyz0vYQhPSDm5FggdnQ4qwQfQSrteAiFxOiDLReGFsSg00FA4wi?= =?us-ascii?Q?YNtfP6/Dlw=3D=3D?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab21901b-caaa-48d7-babe-08da25d45be6 X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB3367.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2022 09:25:23.3832 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ci+v+N9GnV293YxITS1+bO6ZsQpsjmgNQtCG0CMFpDJ7XJBEM+y6Rlwuwfe0ZyqfNtTxpTUgVSmOCOz2E4Pzyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SL2PR06MB3241 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use if and else instead of if(A) and if (!A). Signed-off-by: Wan Jiabing --- drivers/tty/hvc/hvc_opal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index 84776bc641e6..2dafa0964c2a 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/drivers/tty/hvc/hvc_opal.c @@ -344,14 +344,15 @@ void __init hvc_opal_init_early(void) opal = of_find_node_by_path("/ibm,opal/consoles"); 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: " "Found consoles in old location\n"); + else + return; } - if (!opal) - return; + for_each_child_of_node(opal, np) { if (of_node_name_eq(np, "serial")) { stdout_node = np; -- 2.35.1