Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1919087ybh; Sun, 15 Mar 2020 14:28:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt6ABrRy5Jk1hqiPFQocR6LkjHo/hqM+eV1tWGW+9licFKdMANNnSS0ltjTGvD2sZMv3mVe X-Received: by 2002:aca:eb4c:: with SMTP id j73mr14516571oih.145.1584307729839; Sun, 15 Mar 2020 14:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584307729; cv=none; d=google.com; s=arc-20160816; b=aKjGtcPvxngAPK2q3czu6IKzbNQSoB8Ci5PdgBqDx6LarYCHJWvcb1oPSRR/PuK6Lz aQCA7LH50pMvLhqnyIJhWvfKKoO1d2CPglElBPphDYiJ1909HSkyoze8F+kUngzhNbE8 VDo09eMJLlPokxn+hjnRS7PqMEZ9NsUEiCKBmXiAactqV0ZxHpDDHzW47bQNy0LObWFV K2GCE1DghwKD1k87qf4y9MKjFyFwOO/u9CahMCTYbOdBeQYkoigutzup+XdiW2ES8Oi7 GHj8XkQCD69mRITIS+T1AAqdO6Tjo6BpM60j1raPbBDj/WLo+0ZLhoVOrnAZJoPAMMvV WuAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=UrI29gnK2Fgk/ugrno8dGJOP/2UGa5/L2T729KrGlw4=; b=bQTdBnBTPdpIV90RQs85ZYgjkX8r1r3KtTNsb1yA1sZGuPvthhaPbXvEQNBy1bPKnc M2UoYz0GAq1f/SVcDGooDIC6Olrb1fq3wJ7SvB0qWdqWDjgCQwB+2zrYOnAgFamSnJes KSp9z6bSesozyYgfib9MVNG/XTsaJH63CFexcl0+3WGK690PesG8rkuoqGvv/ldI8NQC nFKKfXmFxqLW0mIkaoO6+qBA3D+qJStflvnqYG9PGp0JXUBLH3lt3AHDNUubuLkiBKE4 gnO5s+1N6/c7ir39MNrBkYhPmB1JcqAhLMutBy3YuYPP3yOMwzibc7W12nsFkoJAc/KV sd5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XzswtoS3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si1876573oic.192.2020.03.15.14.28.37; Sun, 15 Mar 2020 14:28:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XzswtoS3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729236AbgCOV1m (ORCPT + 99 others); Sun, 15 Mar 2020 17:27:42 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:44776 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729181AbgCOV1m (ORCPT ); Sun, 15 Mar 2020 17:27:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584307660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UrI29gnK2Fgk/ugrno8dGJOP/2UGa5/L2T729KrGlw4=; b=XzswtoS3NQxAvt0jmvHq9vmA1Bff0Pyi2OozmSyD/7a0U7HeAPPLvRYF3ICOg2yNKiqS/L 9NGqiaUCcOzQQFXae1DbHoucjjXBPDRljxs21oSvjRfrNpUYP+yFNQT9yTEOwFeWrY/Jt1 lHanMXeV2QXyvjhkr7zj6SKFeh4y2vc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-_5NmTzabMsewadlTWehCAA-1; Sun, 15 Mar 2020 17:27:39 -0400 X-MC-Unique: _5NmTzabMsewadlTWehCAA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9221107ACC4; Sun, 15 Mar 2020 21:27:37 +0000 (UTC) Received: from elisabeth (ovpn-200-18.brq.redhat.com [10.40.200.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81D8810027A7; Sun, 15 Mar 2020 21:27:32 +0000 (UTC) Date: Sun, 15 Mar 2020 22:27:23 +0100 From: Stefano Brivio To: Shreeya Patel Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com, daniel.baluta@gmail.com, nramas@linux.microsoft.com, hverkuil@xs4all.nl, Larry.Finger@lwfinger.net Subject: Re: [Outreachy kernel] [PATCH v2] Staging: rtl8723bs: rtw_mlme: Remove unnecessary conditions Message-ID: <20200315222723.666470f7@elisabeth> In-Reply-To: <20200313102912.17218-1-shreeya.patel23498@gmail.com> References: <20200313102912.17218-1-shreeya.patel23498@gmail.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Mar 2020 15:59:12 +0530 Shreeya Patel wrote: > Remove unnecessary if and else conditions since both are leading to the > initialization of "phtpriv->ampdu_enable" with the same value. > Also, remove the unnecessary else-if condition since it does nothing. > > Signed-off-by: Shreeya Patel > --- > > Changes in v2 > - Remove unnecessary comments > - Remove unnecessary else-if condition which does nothing. > > drivers/staging/rtl8723bs/core/rtw_mlme.c | 11 +---------- > 1 file changed, 1 insertion(+), 10 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c > index 71fcb466019a..d7a58af76ea0 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c > @@ -2772,16 +2772,7 @@ 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; > - } > - } else if (pregistrypriv->ampdu_enable == 2) { > - /* remove this part because testbed AP should disable RX AMPDU */ > - /* phtpriv->ampdu_enable = true; */ > + phtpriv->ampdu_enable = true; I suspect this is actually a bug, that is: os_dep/os_intfs.c:74:static int rtw_ampdu_enable = 1;/* for enable tx_ampdu ,0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec) */ and that seems to actually map to the ampdu_enable field in pregistrypriv. However, I wouldn't change this without testing it on the actual hardware, change looks good to me and doesn't affect functionality, Reviewed-by: Stefano Brivio -- Stefano