Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp133455pxb; Mon, 25 Apr 2022 07:11:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwf2Ii5YG2hNJR+Xf6QoCDWw00sDtyc/gL/w0q1Ic85IUPowodU47r4PjlxsHQfUDZfWAJ X-Received: by 2002:a17:907:728c:b0:6e8:a052:4f03 with SMTP id dt12-20020a170907728c00b006e8a0524f03mr16205001ejc.344.1650895868626; Mon, 25 Apr 2022 07:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650895868; cv=none; d=google.com; s=arc-20160816; b=Esw/y5UgSyCzuAbJJcRAuRI0IKb9dvMiQyGGk1slcYmu1l0tl4eBjlSKV+x7yz7t+Z O6wL9DNEPucvGkFbEp3yGxDoif70Ad4qeoiBpEMMhoym3Q8OcYhddBK8ToVDqe0eaei6 GorppTUuVUjSVbKBqpaeASU8bJXZFLag9LCEuaZ8YEK1lhm8h2zNr7tZmQWY7VBT0WJ4 HUu0GrMxyCH9Y3X8BVPT5iQZR1eDFOQA7qmqBz2vP+vOfpN7NKD1i9f9bn9oasY/ckzj U/BcMqS+2p1MAsE55ksedyWqKpyHM90P0qD/Cfk8no/x5St77VIUhZ8se7TKFkVcU/my 8JgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=7gVJ2Utcvosx/ULF+UBSbPDY0euXt/mFCYfcwdEKABE=; b=MFIzDcLjFCDuIJIJWazYFa2ZM4UvH3Ks1/5bg+X9CI4x8187FxzO2QGybnwN606CkC TKCIR8AJyBORPIin1U1lAEdtQ6fVdMLB+JKwHp00oYE6m9hXq5EyFlWaW1mfQ9RAn9bx wVLH7LSTtLkICirT77kcJ6HlkTDTN1bBMoOKm0PqPLqZpX/VuQsnLnTwuJ1ClLdN4mV3 KC8VeucPXJJwaDLaXWvlsO230TJgxBci4kogVE8cHxVlCLXnMztTcUqvFlZbwAw9XK4y aV+KCgKHgPrfwTNTwm9wGUjBEt/6zmaIUBgwDKamrh06aXpPIt5Lm8xUetz4i8aDkLxF 7y1A== ARC-Authentication-Results: i=1; mx.google.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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u25-20020a170906b11900b006e866fda054si2398750ejy.718.2022.04.25.07.10.43; Mon, 25 Apr 2022 07:11:08 -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; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234031AbiDYGAz (ORCPT + 99 others); Mon, 25 Apr 2022 02:00:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbiDYGAr (ORCPT ); Mon, 25 Apr 2022 02:00:47 -0400 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F0B3915B for ; Sun, 24 Apr 2022 22:57:44 -0700 (PDT) Received: by mail-ej1-f54.google.com with SMTP id r13so27523054ejd.5 for ; Sun, 24 Apr 2022 22:57:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=7gVJ2Utcvosx/ULF+UBSbPDY0euXt/mFCYfcwdEKABE=; b=iPTGOxbqIL53Goy2mgOTNQ8ptoW0/oHAmTFOQFPlHhiOucWZBXK1+xDIyji4EZ+ufw xAcYAviMVb2D7XtLRww2tyevHpqBg4cHyj7cCDxkvHa538iPmXsL9XUYp1gq+C5AT1uj p95R4NeHG6F6sXZnP4M2QSHkMHU1l1xDQGMgb6J7hr9OW1oUldRpis//4GFKI5Iizubh 8DVq+U8KEUpIYBfmmA9Xdir5u9LMayvHm43454RVLwJGltPcSH84qsCrXiXyrYlYNbHB 16A+v0yiUsECDpxATWOXqSkDBNmgaJMd0zl9Nt9jljc/heufz3AfJVGxVFrp8M+ZGs0N elJg== X-Gm-Message-State: AOAM533NkqRcjYR3gSK4JqdPCN89h1oU/iStv6AEChi1ys5wr5T4H9y/ n8UyG70Z11rdjrMH9nFVlR8zTFv4KtU= X-Received: by 2002:a17:906:4313:b0:6b8:b3e5:a46 with SMTP id j19-20020a170906431300b006b8b3e50a46mr14695767ejm.417.1650866262907; Sun, 24 Apr 2022 22:57:42 -0700 (PDT) Received: from [192.168.1.49] (185-219-167-24-static.vivo.cz. [185.219.167.24]) by smtp.gmail.com with ESMTPSA id o5-20020a170906974500b006dfc781498dsm3262766ejy.37.2022.04.24.22.57.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Apr 2022 22:57:42 -0700 (PDT) Message-ID: <2c1e137b-9866-4f6b-1413-0adaa8fdd57b@kernel.org> Date: Mon, 25 Apr 2022 07:57:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] tty/hvc_opal: simplify if-if to if-else Content-Language: en-US To: Wan Jiabing , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Greg Kroah-Hartman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: kael_w@yeah.net References: <20220424092511.100309-1-wanjiabing@vivo.com> From: Jiri Slaby In-Reply-To: <20220424092511.100309-1-wanjiabing@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,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 On 24. 04. 22, 11:25, Wan Jiabing wrote: > 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 { This looks good, except missing braces as noted by Joe. > opal = of_find_node_by_path("/ibm,opal"); > if (opal) > pr_devel("hvc_opal: " > "Found consoles in old location\n"); > + else > + return; I am not sure this return is more obvious than the previous one. Rather the opposite, IMO. > } > - if (!opal) > - return; > + > for_each_child_of_node(opal, np) { > if (of_node_name_eq(np, "serial")) { > stdout_node = np; thanks, -- js suse labs