Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5501569iog; Wed, 22 Jun 2022 22:27:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uN54rrXN4lXdNHulQD4Po2+3+WNAD2VgJxMcFP+djrXFGHR4v/vdraFye5xSw6jvhw2mWu X-Received: by 2002:a17:902:b706:b0:168:cca6:8de7 with SMTP id d6-20020a170902b70600b00168cca68de7mr36835537pls.10.1655962066305; Wed, 22 Jun 2022 22:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655962066; cv=none; d=google.com; s=arc-20160816; b=ZUp+dP6rSApjAq25ha4eApjuuyy8v7CRuCITw4HnsBE9tS72Yx9GFGzjp5RIabDeL9 UGpil4PH+M4Dt7OGmUH5sK9JA/ta5DR+pVCDZL9uSGU8/RP4AXhQEld9VWnZYwUTtOeG CsGy2SqqVEEBT7/Ii13d5+7/gTQ5AHRwK2SGtYgEH7Lx2XYGa3C41tPN4lcZVK6aGSOz DSztQ4ZQNlnDGv48dXgsTL6QRKd3vYQqyJf/gDw1Y7ZBya4l2oR9r159IJalShU9Eu38 fd0AL+YUTI2xtkpurneC9TdU3luuh3zqeUhivHW7fwuzHQQf9e1Mk9nKJ0cdOv2IHdqD m7MA== 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=eoUDrMh+erUbdaGJmsTl+ZRL/9QjZmm3J/nLPRs3FRA=; b=bgEUc5vBHYvmoXjRf+MB60m3F9K+WFHmIfDo3czPs6cZ3+4o4AWxnqqIdoGcmDhTeD KElBWyOrLhdhbCGe8vNLDGqvly6RMQOUUFafZ4XxaIa+fOeEiN8ndNIx7R1Rp1+KFB2R nWgaDarHvYikjC4zlRDiTX5bR9xmTsnywZgCMYMUWSckXUCRRjdNuUfyurQ8n1LDMExf o5z4IFSq/Y/1SZnQnaMyZfEooUdNY9HlklzPXp21JIzRP6nb2PpReZ83yYqnQe3LWazA c8gdlGyLtoWNH1vV8zokD2hOaZs+rHgmnWR2+kDvP3QKJLM7dGmqlWMJTLsqh3MS5CGF Iklg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pdeYcyzI; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a63b049000000b003fe4055fa69si25645560pgo.306.2022.06.22.22.27.34; Wed, 22 Jun 2022 22:27:46 -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=@gmail.com header.s=20210112 header.b=pdeYcyzI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbiFWFLc (ORCPT + 99 others); Thu, 23 Jun 2022 01:11:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbiFWFK5 (ORCPT ); Thu, 23 Jun 2022 01:10:57 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680622BB0C for ; Wed, 22 Jun 2022 21:58:34 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id ay16so19197098ejb.6 for ; Wed, 22 Jun 2022 21:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=eoUDrMh+erUbdaGJmsTl+ZRL/9QjZmm3J/nLPRs3FRA=; b=pdeYcyzIM/EeuiIsOGwFOug2CFDdImgKiroLQPKSUymMzgHK9YYCTF2BAEsz6plaEM z0t15pKe5c+FRjMrZ4RmmazpMaPT6a1ytZfgwbCxLAmQoceyLHCTouUvmwJhA5HnLfd8 g0xY9rpDI7/aCcCgsX0C9LS/458kRbfPQhI5W+bQK1qtZDxfmMrFWwPLb4GqYV4ZQvu1 zTG2z8MozpRuOheZ0gHBhjs2Z1hN3C6t5GSw1SIwCKmVidLUp60WvgQLkQGS+WORZ3Th dNY1bsxYk6MAH3rTqsmDEhn6DY5QnO4wYb+BCh9wDLUkxKF2zuZGvW9TN2wuc+BElU02 /M/Q== 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=eoUDrMh+erUbdaGJmsTl+ZRL/9QjZmm3J/nLPRs3FRA=; b=TUvJ1WzqXwNwG0baoqUp+NHgD+gE01ct3BEhn5u1zAVC9x1QTxEzLXWg0dDyRmw3mV Zhivc7Qry4juCzXWy6bpt/iDk+9/kZZZ1hOYzcb0NkNWPS3ib9WFGF9SAETKjqDKdeN7 OOPJtVoLokjpPfSD9P7LBDxl3LaFV7UpW70Ayu2YmHcjNt8/svP8TYLwFnCpIYWNSQiE pUyPptsSEnA2jkXKJLkzBL1fjcUXOKI0iWGk2s8sCn9VtAjRtUPbL2mFS/m6REJb0HBb 4bwDJ0Xueevc6U1dSZ2Ed7o2b+qnF+lTJ+0d+OMwUkmqb+PeXZs95Yi7cWBIu/P3tdmQ Nn7Q== X-Gm-Message-State: AJIora/Pnb8TevOy1mJXEu9WZa+DzdQmDmVyBrhtDtRmAERx9XVY+IkI G1AIuFbUKBb8NZZN8GsA/Oc= X-Received: by 2002:a17:907:3f04:b0:6e8:4b0e:438d with SMTP id hq4-20020a1709073f0400b006e84b0e438dmr6341869ejc.391.1655960312999; Wed, 22 Jun 2022 21:58:32 -0700 (PDT) Received: from ?IPV6:2003:c7:8f2e:6923:8d97:93cc:4023:b7a9? (p200300c78f2e69238d9793cc4023b7a9.dip0.t-ipconnect.de. [2003:c7:8f2e:6923:8d97:93cc:4023:b7a9]) by smtp.gmail.com with ESMTPSA id ff10-20020a1709069c0a00b006fec69696a0sm9970539ejc.220.2022.06.22.21.58.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jun 2022 21:58:32 -0700 (PDT) Message-ID: Date: Thu, 23 Jun 2022 06:58:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] staging: r8188eu: combine nested if statements into one Content-Language: en-US To: Chang Yu , Larry.Finger@lwfinger.net Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20220623031515.402691-1-marcus.yu.56@gmail.com> From: Philipp Hortmann In-Reply-To: <20220623031515.402691-1-marcus.yu.56@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 6/23/22 05:15, Chang Yu wrote: > - if (padapter) { > - if (pfree_recv_queue == &precvpriv->free_recv_queue) > - precvpriv->free_recvframe_cnt++; > - } > + if (padapter && pfree_recv_queue == &precvpriv->free_recv_queue) > + precvpriv->free_recvframe_cnt++; Hi tested with: #include int main() { char padapter = 1; int pfree_recv_queue = 256; int free_recv_queue = 256; if (padapter) { if (pfree_recv_queue == free_recv_queue) printf("Executed before patch: precvpriv->free_recvframe_cnt++;\n"); } if (padapter && pfree_recv_queue == free_recv_queue) printf("Executed after patch: precvpriv->free_recvframe_cnt++;\n"); return 0; } Seems to work. But the rules which operation is done first && or == are not too easy. I would prefer to have: if (padapter && (pfree_recv_queue == free_recv_queue)) So it is very easy to read what is evaluated first. But this is just my opinion and does not have to be right. Thanks for your patch. Bye Philipp