From nobody Mon Feb 9 05:53:04 2026 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FBC23491C8 for ; Sun, 8 Feb 2026 11:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770548506; cv=none; b=r8fbmp+FmEKyuPeZghkm9enDZyaL8tp0wv9c1t9xESevTwOKtGAti3aGjt/lrb823V5WrUglJjo9MZjiIzZ5DbA7T+X6cA104sbuPoWOBvuE24lPiKdJnUILme+DeItIs2MVKEhJOY5RLTqieJihjYzEH7il5DgwikmxByHI590= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770548506; c=relaxed/simple; bh=jzBqcycqna+U5N1lpiyWbUwCRHxxFdgQIguCcwkwTxM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TCQ+2hBgmxRlThq2b/gAFa20HJaaQGPCoFNcSYR5kMku4NbxcmLB/cCV0isYd+w70UEmssDyS9RHvL1I1JeHSKCVe1IQVZ5ynbPTy9U8fopcb+HIaDLRHL+dFNQ0d5bby7GyFS186aX5Kdt3Xg9VQ4T6R/RICLEEhZZOqogSdBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=D/BMuNXy; arc=none smtp.client-ip=95.215.58.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="D/BMuNXy" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1770548504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TzvOSzl1G9Mao9HuA20L4v2TRyJeuTyPYUd84kg/fBE=; b=D/BMuNXyF6UFdafX8MR1ys8+hwcMZO4bi538Xj5j2tzu/o30eVBGCBOZKqBEb2CSHDPyYa SZzdwI2bsN/lA3kJjYATsl2H4Jh8e/42KtmlDX8pYgD1lZLZQFgJzJelM+1CtEg2GP8wYQ o/8q+MLGLOvhkjNU1YpqsEISUhgFiy4= From: luka.gejak@linux.dev To: Greg Kroah-Hartman Cc: Dan Carpenter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH v3 09/22] staging: rtl8723bs: core: fix line lengths in rtw_recv.c Date: Sun, 8 Feb 2026 12:00:58 +0100 Message-ID: <20260208110111.46642-10-luka.gejak@linux.dev> In-Reply-To: <20260208110111.46642-1-luka.gejak@linux.dev> References: <20260208110111.46642-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Luka Gejak Break long lines exceeding 100 characters to comply with kernel coding style. Signed-off-by: Luka Gejak --- drivers/staging/rtl8723bs/core/rtw_recv.c | 120 ++++++++++++++-------- 1 file changed, 80 insertions(+), 40 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rt= l8723bs/core/rtw_recv.c index 337671b1211f..b71f3495d773 100644 --- a/drivers/staging/rtl8723bs/core/rtw_recv.c +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c @@ -47,14 +47,23 @@ signed int _rtw_init_recv_priv(struct recv_priv *precvp= riv, struct adapter *pada =20 precvpriv->free_recvframe_cnt =3D NR_RECVFRAME; =20 - precvpriv->pallocated_frame_buf =3D vzalloc(NR_RECVFRAME * sizeof(union r= ecv_frame) + RXFRAME_ALIGN_SZ); + { + size_t sz =3D NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ; + + precvpriv->pallocated_frame_buf =3D vzalloc(sz); + } =20 if (!precvpriv->pallocated_frame_buf) { res =3D _FAIL; goto exit; } =20 - precvpriv->precv_frame_buf =3D (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv= ->pallocated_frame_buf), RXFRAME_ALIGN_SZ); + { + SIZE_PTR aligned =3D N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_fr= ame_buf), + RXFRAME_ALIGN_SZ); + + precvpriv->precv_frame_buf =3D (u8 *)aligned; + } /* precvpriv->precv_frame_buf =3D precvpriv->pallocated_frame_buf + RXFRA= ME_ALIGN_SZ - */ /* ((SIZE_PTR) (precvpriv->pallocated_frame_buf) &(RXFRAME_ALIGN_SZ-1)); = */ =20 @@ -390,11 +399,15 @@ static signed int recvframe_chkmic(struct adapter *ad= apter, union recv_frame *p mickey =3D &stainfo->dot11tkiprxmickey.skey[0]; } =20 - datalen =3D precvframe->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len-p= rxattrib->icv_len-8;/* icv_len included the mic code */ + /* icv_len included the mic code */ + datalen =3D precvframe->u.hdr.len - prxattrib->hdrlen - + prxattrib->iv_len - prxattrib->icv_len - 8; pframe =3D precvframe->u.hdr.rx_data; - payload =3D pframe+prxattrib->hdrlen+prxattrib->iv_len; + payload =3D pframe + prxattrib->hdrlen + prxattrib->iv_len; =20 - rtw_seccalctkipmic(mickey, pframe, payload, datalen, &miccode[0], (unsi= gned char)prxattrib->priority); /* care the length of the data */ + /* care the length of the data */ + rtw_seccalctkipmic(mickey, pframe, payload, datalen, + &miccode[0], (unsigned char)prxattrib->priority); =20 pframemic =3D payload+datalen; =20 @@ -409,7 +422,10 @@ static signed int recvframe_chkmic(struct adapter *ada= pter, union recv_frame *p if (bmic_err =3D=3D true) { /* double check key_index for some timing issue , */ /* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause t= iming issue */ - if ((is_multicast_ether_addr(prxattrib->ra) =3D=3D true) && (prxattri= b->key_index !=3D pmlmeinfo->key_index)) + bool is_mcast =3D is_multicast_ether_addr(prxattrib->ra); + bool key_mismatch =3D prxattrib->key_index !=3D pmlmeinfo->key_index; + + if (is_mcast && key_mismatch) brpt_micerror =3D false; =20 if (prxattrib->bdecrypted && brpt_micerror) @@ -463,28 +479,37 @@ static union recv_frame *decryptor(struct adapter *pa= dapter, union recv_frame *p } } =20 - if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted =3D=3D 0) || (pse= curitypriv->sw_decrypt =3D=3D true))) { - psecuritypriv->hw_decrypted =3D false; + { + bool need_decrypt =3D prxattrib->encrypt > 0; + bool not_decrypted =3D !prxattrib->bdecrypted; + bool sw_decrypt =3D psecuritypriv->sw_decrypt; + bool decrypted_ok; =20 - switch (prxattrib->encrypt) { - case _WEP40_: - case _WEP104_: - rtw_wep_decrypt(padapter, (u8 *)precv_frame); - break; - case _TKIP_: - res =3D rtw_tkip_decrypt(padapter, (u8 *)precv_frame); - break; - case _AES_: - res =3D rtw_aes_decrypt(padapter, (u8 *)precv_frame); - break; - default: + if (need_decrypt && (not_decrypted || sw_decrypt)) { + psecuritypriv->hw_decrypted =3D false; + + switch (prxattrib->encrypt) { + case _WEP40_: + case _WEP104_: + rtw_wep_decrypt(padapter, (u8 *)precv_frame); + break; + case _TKIP_: + res =3D rtw_tkip_decrypt(padapter, (u8 *)precv_frame); + break; + case _AES_: + res =3D rtw_aes_decrypt(padapter, (u8 *)precv_frame); + break; + default: break; + } + } else { + decrypted_ok =3D prxattrib->bdecrypted =3D=3D 1 && + prxattrib->encrypt > 0 && + (psecuritypriv->busetkipkey =3D=3D 1 || + prxattrib->encrypt !=3D _TKIP_); + if (decrypted_ok) + psecuritypriv->hw_decrypted =3D true; } - } else if (prxattrib->bdecrypted =3D=3D 1 && prxattrib->encrypt > 0 && - (psecuritypriv->busetkipkey =3D=3D 1 || prxattrib->encrypt !=3D _TKIP= _) - ) { - psecuritypriv->hw_decrypted =3D true; - } else { } =20 if (res =3D=3D _FAIL) { @@ -564,7 +589,8 @@ static union recv_frame *portctrl(struct adapter *adapt= er, union recv_frame *pre return prtnframe; } =20 -static signed int recv_decache(union recv_frame *precv_frame, u8 bretry, s= truct stainfo_rxcache *prxcache) +static signed int recv_decache(union recv_frame *precv_frame, u8 bretry, + struct stainfo_rxcache *prxcache) { signed int tid =3D precv_frame->u.hdr.attrib.priority; =20 @@ -669,7 +695,8 @@ static void process_wmmps_data(struct adapter *padapter= , union recv_frame *precv } } =20 -static void count_rx_stats(struct adapter *padapter, union recv_frame *prf= rame, struct sta_info *sta) +static void count_rx_stats(struct adapter *padapter, union recv_frame *prf= rame, + struct sta_info *sta) { int sz; struct sta_info *psta =3D NULL; @@ -1149,7 +1176,8 @@ static union recv_frame *recvframe_defrag(struct adap= ter *adapter, } =20 /* check if need to defrag, if needed queue the frame to defrag_q */ -static union recv_frame *recvframe_chk_defrag(struct adapter *padapter, un= ion recv_frame *precv_frame) +static union recv_frame *recvframe_chk_defrag(struct adapter *padapter, + union recv_frame *precv_frame) { u8 ismfrag; u8 fragnum; @@ -1257,7 +1285,8 @@ static signed int validate_recv_mgnt_frame(struct ada= pter *padapter, union recv_ =20 { /* for rx pkt statistics */ - struct sta_info *psta =3D rtw_get_stainfo(&padapter->stapriv, GetAddr2Pt= r(precv_frame->u.hdr.rx_data)); + u8 *addr2 =3D GetAddr2Ptr(precv_frame->u.hdr.rx_data); + struct sta_info *psta =3D rtw_get_stainfo(&padapter->stapriv, addr2); =20 if (psta) { psta->sta_stats.rx_mgnt_pkts++; @@ -1622,7 +1651,8 @@ static signed int wlanhdr_to_ethhdr(union recv_frame = *precvframe) return _SUCCESS; } =20 -static struct sk_buff *rtw_alloc_msdu_pkt(union recv_frame *prframe, u16 n= Subframe_Length, u8 *pdata) +static struct sk_buff *rtw_alloc_msdu_pkt(union recv_frame *prframe, + u16 nSubframe_Length, u8 *pdata) { u16 eth_type; struct sk_buff *sub_skb; @@ -1662,7 +1692,8 @@ static struct sk_buff *rtw_alloc_msdu_pkt(union recv_= frame *prframe, u16 nSubfra return sub_skb; } =20 -static void rtw_recv_indicate_pkt(struct adapter *padapter, struct sk_buff= *pkt, struct rx_pkt_attrib *pattrib) +static void rtw_recv_indicate_pkt(struct adapter *padapter, struct sk_buff= *pkt, + struct rx_pkt_attrib *pattrib) { struct mlme_priv *pmlmepriv =3D &padapter->mlmepriv; =20 @@ -1812,7 +1843,8 @@ static int check_indicate_seq(struct recv_reorder_ctr= l *preorder_ctrl, u16 seq_n return true; } =20 -static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ct= rl, union recv_frame *prframe) +static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ct= rl, + union recv_frame *prframe) { struct rx_pkt_attrib *pattrib =3D &prframe->u.hdr.attrib; struct __queue *ppending_recvframe_queue =3D &preorder_ctrl->pending_recv= frame_queue; @@ -1894,7 +1926,9 @@ static int rtw_recv_indicatepkt(struct adapter *padap= ter, union recv_frame *prec return _FAIL; } =20 -static int recv_indicatepkts_in_order(struct adapter *padapter, struct rec= v_reorder_ctrl *preorder_ctrl, int bforced) +static int recv_indicatepkts_in_order(struct adapter *padapter, + struct recv_reorder_ctrl *preorder_ctrl, + int bforced) { struct list_head *phead, *plist; union recv_frame *prframe; @@ -2093,7 +2127,8 @@ static int process_recv_indicatepkts(struct adapter *= padapter, union recv_frame if (phtpriv->ht_option =3D=3D true) { /* B/G/N Mode */ /* prframe->u.hdr.preorder_ctrl =3D &precvpriv->recvreorder_ctrl[pattrib= ->priority]; */ =20 - if (recv_indicatepkt_reorder(padapter, prframe) !=3D _SUCCESS) { /* inc= luding perform A-MPDU Rx Ordering Buffer Control */ + /* including perform A-MPDU Rx Ordering Buffer Control */ + if (recv_indicatepkt_reorder(padapter, prframe) !=3D _SUCCESS) { =20 if ((padapter->bDriverStopped =3D=3D false) && (padapter->bSurpriseRemoved =3D=3D false)) { @@ -2252,12 +2287,15 @@ static void rtw_signal_stat_timer_hdl(struct timer_= list *t) u8 avg_signal_qual =3D 0; u32 num_signal_strength =3D 0; u32 __maybe_unused num_signal_qual =3D 0; - u8 _alpha =3D 5; /* this value is based on converging_constant =3D 5000 = and sampling_interval =3D 1000 */ + /* based on converging_constant =3D 5000 and sampling_interval =3D 1000 */ + u8 _alpha =3D 5; =20 if (adapter->recvpriv.is_signal_dbg) { /* update the user specific value, signal_strength_dbg, to signal_streng= th, rssi */ - adapter->recvpriv.signal_strength =3D adapter->recvpriv.signal_strength_= dbg; - adapter->recvpriv.rssi =3D (s8)translate_percentage_to_dbm((u8)adapter->= recvpriv.signal_strength_dbg); + u8 strength_dbg =3D adapter->recvpriv.signal_strength_dbg; + + adapter->recvpriv.signal_strength =3D strength_dbg; + adapter->recvpriv.rssi =3D (s8)translate_percentage_to_dbm(strength_dbg); } else { =20 if (recvpriv->signal_strength_data.update_req =3D=3D 0) {/* update_req = is clear, means we got rx */ @@ -2275,9 +2313,11 @@ static void rtw_signal_stat_timer_hdl(struct timer_l= ist *t) } =20 if (num_signal_strength =3D=3D 0) { - if (rtw_get_on_cur_ch_time(adapter) =3D=3D 0 || - jiffies_to_msecs(jiffies - rtw_get_on_cur_ch_time(adapter)) < 2 * a= dapter->mlmeextpriv.mlmext_info.bcn_interval - ) { + unsigned long on_ch_time =3D rtw_get_on_cur_ch_time(adapter); + u32 bcn_intvl =3D adapter->mlmeextpriv.mlmext_info.bcn_interval; + + if (on_ch_time =3D=3D 0 || + jiffies_to_msecs(jiffies - on_ch_time) < 2 * bcn_intvl) { goto set_timer; } } --=20 2.52.0