Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp30167lfe; Fri, 15 Apr 2022 17:58:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgD9l7l0M36sOv91KQ0TE853E6MJzlj3M8DmMNLsyL6ZQ0qSl3ABMaiozUJMTN48BhqwxO X-Received: by 2002:a17:90a:68c3:b0:1cb:a136:76a0 with SMTP id q3-20020a17090a68c300b001cba13676a0mr6952397pjj.101.1650070726220; Fri, 15 Apr 2022 17:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650070726; cv=none; d=google.com; s=arc-20160816; b=sklNCnJEmxBI5Ip2upEK7kZ1tmTXb8Nga4eL9xZcefQdqJuhQc1le/y4ooF02Sp5BF 4Jsa8qESZ4CRa6Nkow4UK2AJ0Z1ahXFw4KvzQgF37XnbyxPv6WqWlYvpLRr/fupVlTpR 6RrccOlQPjLZ1h9D9hpl6t+lWPh5t4DyQYVkHiBpJJMV8esbcGW3OZ1V+vga8aC7Ys/s 9J1BUeaTT0JMkb8AsfrKyLv+cSRBEXk84viD213sXtnN8WGx9sa1T4EdeBNcppW6lEWz kocvLzvx7fitirn6WfDC8wp6zXlw5bp0GtLssXoyLQsYSkm7hOAuVEuWhcjo4exIIdBF s4WA== 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:dkim-signature; bh=SXwXBdQqg3w0Na7l4QbphKGJc3ZMWJFk1TEWGHJVyNM=; b=v6RbziHpP2DQbzV17A1za9DWE/Lh0HuPTjw2ZnNGM6fmA1DMCHsFIjxwyRCCc0p+qN tce7EjL4FryO85a9Bor5Jph1cvm1h8SrJMibM9jLGyfgJZrL1+fsz7Clkcc7dRz+f3+3 sMvKevTQENcLu1A8+gY+fKHyvHvxf8xOCaOfLQCWVjUV3IoKoYN9z9IzZdDE6QHJG82a 9f07DQ3KdDJD1OiCeu8CMNFSmutjsySLOCPFZ9QMKaPA+5lpcL6ii1MFd7nAozBMAFxV wij6M006V35yBzHAF5uyHCa9atKfjgf3lgY3Mxt4P7jsJtL244p9oRDg/EXsB2hQzE2Q Eseg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=IRieHLE8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mw8-20020a17090b4d0800b001cd5b88c619si3387251pjb.32.2022.04.15.17.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:58:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=IRieHLE8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B9136121501; Fri, 15 Apr 2022 17:44:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356391AbiDOXFb (ORCPT + 99 others); Fri, 15 Apr 2022 19:05:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231347AbiDOXF3 (ORCPT ); Fri, 15 Apr 2022 19:05:29 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A02167D3B; Fri, 15 Apr 2022 16:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1650063780; x=1681599780; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=SXwXBdQqg3w0Na7l4QbphKGJc3ZMWJFk1TEWGHJVyNM=; b=IRieHLE8uz5anchfW4gaXjIx87uxIGJy3MOhaaBPIZWmUDdIwFUYe6oI WYbz/9xS3blV0v6LV85CRSB8EAbSJyIG9Q8+N7ovjIQqX9sksUnXrBGCD lV3eGWgjCo/v4wPaDPNb5K/4ecLbrUeX26oFQzHCqzoZZBGEkdh0NNqCC s=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-02.qualcomm.com with ESMTP; 15 Apr 2022 16:02:59 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2022 16:02:59 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 15 Apr 2022 16:02:59 -0700 Received: from [10.110.103.65] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 15 Apr 2022 16:02:58 -0700 Message-ID: Date: Fri, 15 Apr 2022 16:02:57 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v2] ath11k: simplify if-if to if-else Content-Language: en-US To: Yihao Han , Kalle Valo , "David S. Miller" , Jakub Kicinski , Paolo Abeni , , , , CC: References: <20220415125853.86418-1-hanyihao@vivo.com> From: Jeff Johnson In-Reply-To: <20220415125853.86418-1-hanyihao@vivo.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 4/15/2022 5:58 AM, Yihao Han wrote: > Replace `if (!ab->is_reset)` with `else` for simplification > according to the kernel coding style: > > "Do not unnecessarily use braces where a single statement will do." > > ... > > "This does not apply if only one branch of a conditional statement is > a single statement; in the latter case use braces in both branches" > > Please refer to: > https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html why are you referring to braces when your patch has nothing to do with braces? changing if (foo) X;if (!foo) Y; to if (foo) X else Y; is not a design pattern referenced in the coding style > > Suggested-by: Benjamin Poirier > Signed-off-by: Yihao Han > --- > v2:edit commit message > --- > drivers/net/wireless/ath/ath11k/core.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c > index cbac1919867f..80009482165a 100644 > --- a/drivers/net/wireless/ath/ath11k/core.c > +++ b/drivers/net/wireless/ath/ath11k/core.c > @@ -1532,8 +1532,7 @@ static void ath11k_core_restart(struct work_struct *work) > > if (ab->is_reset) > complete_all(&ab->reconfigure_complete); > - > - if (!ab->is_reset) > + else > ath11k_core_post_reconfigure_recovery(ab); > } >