From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C4F323A0; Thu, 21 Apr 2022 19:52:18 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id b19so8074733wrh.11; Thu, 21 Apr 2022 12:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BQ5dyd6fs/bmeT8pS5RVio7sbjG930KgOScg6ZzdPYo=; b=BbVajbWzTI9iuTT8JJXqugzc+jYRncQ2CahBLrh1s0jY529GXxKHFiDclAFH4xjuv1 5fMoB1rGe4LhMTtHVm01nDiM4LVubcEJKNUij/1P+Cm8oSIDB92SAJac8BryUCWv1ZCh 9DoIuvyNbSaxE42uLvVyUpAoEv6ufGe+ijlGiYKknamH0//ETKR9nVWmyP7N0dR/qNoY ESciveBBXx8JIKKr7vEQQ7mu88IpvCZ8vz/HJUP7U2gv2bAELU1ql3thEQd7Dy2Vj7VW XGaJDBWbWWWIpEGbzKleZ9vB+oWrwQacCQefiqtwztcPjK96SD+WkDSQq7OY1gvu4ISl GOgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BQ5dyd6fs/bmeT8pS5RVio7sbjG930KgOScg6ZzdPYo=; b=iRBmYFKCTEFYkUbDnU8KJJLt3H3EeGrisAEgVxHd5eInis9jeOG8M01dyjTUcuzIfC 4u7VB//5/q1GT1MSTXl/wIoEia7RWaMsL3tvMYPydgK7Emj5R180abhM2Mk2tG91651Y gOd1rc6mDzGsVgD2NTzRMc7guzAbdH9hBfYF9zctma2Clt15q4luXZGPVhB+vhgeWqwd Ipq7wyryXGrAbgARdUSiVsmsAJx1a4QGuYBpeJS9MLEMuBjrR0FnYNR0PJ4UFclLqr4d fWaAP5qXnNKZ/dzEXbNJt90u/Eqa7SsQ6IxmVy94QCbbXDS0nMxsd4Lh9OdrPgunvVMo aYbA== X-Gm-Message-State: AOAM5303lN1KSIRMGDUi2zQrpMSVoAHRDgamgIgYeJXp0Ti6R7h5bezX TXUYxCdPkC7t/ym9kbq6iN4= X-Google-Smtp-Source: ABdhPJzN6SNNtwOoCtQDCY9KQ49Aeegx8MoX9dTJFyJTMUvteQbKMvaqYB6aDL49STrkEKq4lk9FAA== X-Received: by 2002:a05:6000:111:b0:207:ac77:3d07 with SMTP id o17-20020a056000011100b00207ac773d07mr977069wrx.136.1650570736840; Thu, 21 Apr 2022 12:52:16 -0700 (PDT) Received: from leap.localnet (host-79-50-86-254.retail.telecomitalia.it. [79.50.86.254]) by smtp.gmail.com with ESMTPSA id z3-20020a1cf403000000b0037d1f4a2201sm2776214wma.21.2022.04.21.12.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 12:52:15 -0700 (PDT) From: "Fabio M. De Francesco" To: Larry.Finger@lwfinger.net, Jaehee Park Cc: phil@philpotter.co.uk, gregkh@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev, jhpark1013@gmail.com Subject: Re: [PATCH v4 1/7] staging: r8188eu: remove unnecessary braces in single statement block Date: Thu, 21 Apr 2022 21:52:14 +0200 Message-ID: <16185752.0ZKypZ73Fx@leap> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On gioved=C3=AC 21 aprile 2022 21:20:26 CEST Jaehee Park wrote: > Remove braces for single statement block to minimize the number of > empty lines, without loss of readability. Issue found with checkpatch. > WARNING: braces {} are not necessary for single statement blocks >=20 > Signed-off-by: Jaehee Park > --- > drivers/staging/r8188eu/core/rtw_mlme.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/ r8188eu/core/rtw_mlme.c > index 3e9882f89f76..d3f4d7cdfa08 100644 > --- a/drivers/staging/r8188eu/core/rtw_mlme.c > +++ b/drivers/staging/r8188eu/core/rtw_mlme.c > @@ -112,9 +112,8 @@ void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) > =20 > rtw_free_mlme_priv_ie_data(pmlmepriv); > =20 > - if (pmlmepriv) { > + if (pmlmepriv) > vfree(pmlmepriv->free_bss_buf); > - } > =20 > } > =20 > --=20 > 2.25.1 >=20 Hi Jaehee, If you just want to remove the braces, your patch is good. But... Did you ask yourself why this code needs to test if "pmlmepriv" is=20 valid before calling vfree() on it? Actually, the code doesn't need this=20 test, it just needs to call "vfree(pmlmepriv)" unconditionally. OK, I know that this is not directly related to your patch or any other=20 that is explicitly made just for removing unnecessary braces...=20 vfree() behaves as a no-op function on NULL pointers, therefore there is no= =20 need to test whether or not "pmlmepriv" is valid. Thanks, =46abio M. De Francesco