All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Deepak Varma <mh12gx2825@gmail.com>
Cc: outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: Re: [Outreachy kernel] [PATCH] Staging: rtl8723bs: rtw_mlme: Remove unnecessary conditions
Date: Wed, 11 Mar 2020 21:26:42 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.2003112125030.6093@hadrien> (raw)
In-Reply-To: <92b5d69a-d4e6-480d-82ef-3a01b893fbd0@googlegroups.com>

[-- Attachment #1: Type: text/plain, Size: 3084 bytes --]



On Wed, 11 Mar 2020, Deepak Varma wrote:

>
>
> On Wednesday, 11 March 2020 19:29:13 UTC+5:30, Shreeya Patel wrote:
>       Remove unnecessary if and else conditions since both are leading
>       to the
>       initialization of "phtpriv->ampdu_enable" with the same value.
>
>       Signed-off-by: Shreeya Patel <shreeya....@gmail.com>
>       ---
>        drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 +++-------
>        1 file changed, 3 insertions(+), 7 deletions(-)
>
>       diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c
>       b/drivers/staging/rtl8723bs/core/rtw_mlme.c
>       index 71fcb466019a..48e9faf27321 100644
>       --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
>       +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
>       @@ -2772,13 +2772,9 @@ void rtw_update_ht_cap(struct adapter
>       *padapter, u8 *pie, uint ie_len, u8 channe
>        
>                /* maybe needs check if ap supports rx ampdu. */
>                if (!(phtpriv->ampdu_enable) &&
>       pregistrypriv->ampdu_enable == 1) {
>       -                if (pregistrypriv->wifi_spec == 1) {
>       -                        /* remove this part because testbed AP
>       should disable RX AMPDU */
>       -                        /* phtpriv->ampdu_enable = false; */
>       -                        phtpriv->ampdu_enable = true;
>       -                } else {
>       -                        phtpriv->ampdu_enable = true;
>       -                }
>       +                /* remove this part because testbed AP should
>       disable RX AMPDU */
>       +                /* phtpriv->ampdu_enable = false; */
>       +                phtpriv->ampdu_enable = true;
>                } else if (pregistrypriv->ampdu_enable == 2) {
>                        /* remove this part because testbed AP should
>       disable RX AMPDU */
>                        /* phtpriv->ampdu_enable = true; */
>       --
>       2.17.1
>
>  Juia, can you comment if the 2 commented lines [with '+' sign now] may also
> be removed to further simplify the code?

I feel uneasy about the whole change, without having more knowledge of the
device.  Someone already suggested that the code should be removed, but it
seems they didn't do it.  Maybe they didn't do it for a reason...

On the other hand, if the "if" is useless, the comments don't seem useful
either, since they applied to only one of the branches.

julia

>
> Deepak.
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/92b5d69a-d4e6-480d-82ef-
> 3a01b893fbd0%40googlegroups.com.
>
>

  reply	other threads:[~2020-03-11 20:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 13:58 [Outreachy kernel] [PATCH] Staging: rtl8723bs: rtw_mlme: Remove unnecessary conditions Shreeya Patel
2020-03-11 13:58 ` Shreeya Patel
2020-03-11 20:17 ` Deepak Varma
2020-03-11 20:26   ` Julia Lawall [this message]
2020-03-12  2:42 ` Lakshmi Ramasubramanian
2020-03-12  2:42   ` Lakshmi Ramasubramanian
2020-03-12 10:34   ` Stefano Brivio
2020-03-12 10:34     ` Stefano Brivio
2020-03-12 10:49     ` Julia Lawall
2020-03-12 10:49       ` Julia Lawall
2020-03-12 16:31       ` Lakshmi Ramasubramanian
2020-03-12 16:31         ` Lakshmi Ramasubramanian
2020-03-13  7:48   ` Dan Carpenter
2020-03-13  7:48     ` Dan Carpenter
2020-03-13  7:43 ` Dan Carpenter
2020-03-13  7:43   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.2003112125030.6093@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=mh12gx2825@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.