From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 4E716431A55 for ; Mon, 3 Aug 2026 18:07:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785780459; cv=none; b=BY7D9Gm1Q5uib4ulEWXz1p26kn3to1XRorFbsIlbAC3mRuaAQxxieS3TPv4lH98GUGnOLF69NPA2ebd67pGwtCoxJm8bicdrI53V/Zs6+PXAWSJT9/TvfqbPNvvocy79h6RiXTh/BQX4bEYkDVfEkPVVCjOysOwqKFxG80haZyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785780459; c=relaxed/simple; bh=ThD+P9qyB7OY60ZmZY9/ncBKucTYVoXFd7e/E8fiDI4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gr8mkZT6fDsKce+NxPR2+kp4LcXDGKgQiQ6KEsedKwDpjHGi7cn89fpvgWqI4/ycKYIj16lBZbJFmkG9/MaMevYLPCbFYn/iTRtumjMTtnUeZ/0535/IhAptymil+4YZMGdGTns3GcbD6EDUrqD+3RewKKqbdFVxtSlcb5rLGZw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UX6EAROp; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UX6EAROp" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-c99eaa1f020so3611271a12.2 for ; Mon, 03 Aug 2026 11:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785780458; x=1786385258; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=KTCn0Jr82Mg/B2iO/GPghHVILY1gFGfC6P6rv8l1E7w=; b=UX6EAROpqdxkg8rJSYClcUEJZGPzzETyF3NmIQFGsjrip9LoRHlmAKZ6oOPIfoaSTD a7r6UuSQdn9qfXuMTPbbjxxPWJ8QIiMlc7Xo4rmCO6Au7SZn5zoav86snNjTGf6ao6Ux d8Di1meDQSer4R9ohRDDtz83yaD4MpV2dmxVE0z/vrsy5YA8d6A1FXcWryeCNtyHaY/m iClqBbVCQxE/JpG/OoL+2/YwPntE0JK0zdpsgw3ChSt9Et9TcOV/ZlIrUGt/pJXgx1c8 kjs1ayajWfvIVj8j/X+EmMWeMqO6qUZwXrcmEapinsJmfDPvFnD4mJOQiD0k5ANhQ3Bl 84gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785780458; x=1786385258; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=KTCn0Jr82Mg/B2iO/GPghHVILY1gFGfC6P6rv8l1E7w=; b=r6QhV9KY1nd4CpkQdUCj7YagWm37cKcL6lUVq1eBKs8FwcVZPYN8MTCdR5+cxUwgyu ha2bHPIFwWn6GBZQufhA6uA1kcMPhKeX6QRO+jEBeEQL/stUME9Y6Q8G1EKZlY766unZ jX2+cpQFxSm4iqAPg0qxbb8XEnYZKLtD1jwPGn5LZc4SVi0BPRRnjMGqk8edoeIFTCyw 745b5NFyJrsQJJPaZwyxe42OT59c60P7G6ARhuk+WliLhMLu0uH7w2Z/AsukVbPD3b/T 8sJ1kitb/So/hX7pHfD8ijwG77aBdTiRZJxIoz0X8JTgK/4InZRdWlMEzDsIPyljVmhZ P6/A== X-Forwarded-Encrypted: i=1; AHgh+Rq7zdAP2uxw5LoX3Zu9ryGp0rKCt11CF1YRqljCG1k+oddhCxKEv5VNy9FCGo0aQ1HQEiGdDKQc1u1BTvk=@vger.kernel.org X-Gm-Message-State: AOJu0YysImpri7S7Q0lKPBOiQP52870Nu5noj34jUvG18t9nsFsrBlPO +XFq2mk63At65eOcZObF82G1SqNPqoPYTXcQMG1Ch8kc7KQTa7CqKzYA X-Gm-Gg: AR+sD126uJLg3A8IClSc4n5gnGGKqyteIoQuK2DCqW29a0gkSjJncTGsR80cYq1beQt NQbSIJ8cOTNjW2p7hXtVrsc3fNl0cq9TKU9dYKDbs8MTxDzx2Z69HNvsVzYsGHL1X8gAkacNGz7 PYnV16iRoqvPNHYcvuztzPecaRsw6VF/NaA5vg3NuAveeouaZlDqeOBJ5YH8yeLJstv6bqrNu+w rT9mbY1AcD8H9SGdkIsKCz5X8BKVcz8RmZiAPBT4Aqnn4E/jgd2a0+y08u2OJBNPadL3Z8MpFym +1gJcEU5qIcm066iO8mnhyVvZXbqHYYzXxHlAvinOvl/IqZy5hh/8uQ3yd01zfZgSOUOgh/JTIe xaJKl11PYHVPSY1LvWAnulqdCcBrsnSlKOBkCuw7VK39ZXtv0H2WTH/EGN5kamNZKvF2GB3BFtB Uxm4aPOq5iNYAEI3LzbV2+wpnvjQeFKOQkQRa0ksjRXTcQG17HYWqB6vXKQZfuGURGPjghtvraX cY0GfR3bFcZTBUhhLiUsWEK X-Received: by 2002:a05:6a20:4e92:b0:3c3:bb13:438 with SMTP id adf61e73a8af0-3c92a74cf9emr11526162637.32.1785780457502; Mon, 03 Aug 2026 11:07:37 -0700 (PDT) Received: from Debian.tail44843d.ts.net ([183.82.161.178]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3153e06f88fsm39086876eec.20.2026.08.03.11.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 11:07:37 -0700 (PDT) From: Mirza Ishan Beg To: gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, nikolayof23@gmail.com, seedandsyntax@gmail.com Subject: [PATCH v3] staging: rtl8723bs: refactor traffic_stat access in collect_traffic_statistics Date: Mon, 3 Aug 2026 23:33:29 +0530 Message-ID: <20260803180549.20859-1-seedandsyntax@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260803160055.18205-1-seedandsyntax@gmail.com> References: <20260803160055.18205-1-seedandsyntax@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Replace repetitive `pdvobjpriv->traffic_stat.` dereferencing with a local pointer `ts` to improve readability and reduce line length. This resolves multiple checkpatch line-length warnings without manual wrapping. Suggested-by: Nikolay Kulikov Signed-off-by: Mirza Ishan Beg Link: https://lore.kernel.org/linux-staging/agDaGJ5UKndFUNPY@archlinux/ --- Changes in v3: - Fix missing semicolon in pointer declaration Changes in v2: - Added Link: tag with lore URL as suggested by Greg KH drivers/staging/rtl8723bs/core/rtw_cmd.c | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index ce3dfa1fee26..4aa430284a59 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -1109,25 +1109,26 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter) static void collect_traffic_statistics(struct adapter *padapter) { struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); + struct traffic_stat *ts = &pdvobjpriv->traffic_stat; /* Tx */ - pdvobjpriv->traffic_stat.tx_bytes = padapter->xmitpriv.tx_bytes; - pdvobjpriv->traffic_stat.tx_pkts = padapter->xmitpriv.tx_pkts; - pdvobjpriv->traffic_stat.tx_drop = padapter->xmitpriv.tx_drop; + ts->tx_bytes = padapter->xmitpriv.tx_bytes; + ts->tx_pkts = padapter->xmitpriv.tx_pkts; + ts->tx_drop = padapter->xmitpriv.tx_drop; /* Rx */ - pdvobjpriv->traffic_stat.rx_bytes = padapter->recvpriv.rx_bytes; - pdvobjpriv->traffic_stat.rx_pkts = padapter->recvpriv.rx_pkts; - pdvobjpriv->traffic_stat.rx_drop = padapter->recvpriv.rx_drop; + ts->rx_bytes = padapter->recvpriv.rx_bytes; + ts->rx_pkts = padapter->recvpriv.rx_pkts; + ts->rx_drop = padapter->recvpriv.rx_drop; /* Calculate throughput in last interval */ - pdvobjpriv->traffic_stat.cur_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes - pdvobjpriv->traffic_stat.last_tx_bytes; - pdvobjpriv->traffic_stat.cur_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes - pdvobjpriv->traffic_stat.last_rx_bytes; - pdvobjpriv->traffic_stat.last_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes; - pdvobjpriv->traffic_stat.last_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes; + ts->cur_tx_bytes = ts->tx_bytes - ts->last_tx_bytes; + ts->cur_rx_bytes = ts->rx_bytes - ts->last_rx_bytes; + ts->last_tx_bytes = ts->tx_bytes; + ts->last_rx_bytes = ts->rx_bytes; - pdvobjpriv->traffic_stat.cur_tx_tp = (u32)(pdvobjpriv->traffic_stat.cur_tx_bytes * 8 / 2 / 1024 / 1024); - pdvobjpriv->traffic_stat.cur_rx_tp = (u32)(pdvobjpriv->traffic_stat.cur_rx_bytes * 8 / 2 / 1024 / 1024); + ts->cur_tx_tp = (u32)(ts->cur_tx_bytes * 8 / 2 / 1024 / 1024); + ts->cur_rx_tp = (u32)(ts->cur_rx_bytes * 8 / 2 / 1024 / 1024); } bool traffic_status_watchdog(struct adapter *padapter, bool from_timer) -- 2.47.3