* Re: [PATCH 4/5] staging: sm750fb: use ARRAY_SIZE macro in fb_find_mode loop
From: Ahmet Sezgin Duran @ 2026-05-23 15:06 UTC (permalink / raw)
To: Dan Carpenter; +Cc: gregkh, linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <ahF8dacOkX0tdxGf@stanley.mountain>
On 5/23/26 1:07 PM, Dan Carpenter wrote:
> I don't love this. As you mentioned, there are two arrays and they
> both have 3 elements. Why prefer one over the other? This patch
> makes the code look simpler than it really is. I would just leave
> it as 3.
>
> regards,
> dan carpenter
>
Fair. Going to drop that and send v2.
Thanks for the review.
Regards,
Ahmet Sezgin Duran
^ permalink raw reply
* [PATCH v2] staging: rtl8723bs: fix unnamed parameters warning detected at checkpatch
From: Rodrigo Gobbi @ 2026-05-23 14:18 UTC (permalink / raw)
To: gregkh
Cc: ~lkcamp/patches, linux-staging, linux-kernel,
linux-kernel-mentees, a.nasrolahi01
Detected the following WARNING: function definition argument
'struct adapter *' should also have an identifier name.
Add explicit names on those definitions.
Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
---
Changelog:
v2: use adapter instead of padapter
v1: https://lore.kernel.org/all/20260407133416.13983-1-rodrigo.gobbi.7@gmail.com/
---
drivers/staging/rtl8723bs/include/hal_intf.h | 2 +-
drivers/staging/rtl8723bs/include/rtw_btcoex.h | 10 +++++-----
drivers/staging/rtl8723bs/include/rtw_pwrctrl.h | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8723bs/include/hal_intf.h b/drivers/staging/rtl8723bs/include/hal_intf.h
index b193854bfe6e..55c0010968a3 100644
--- a/drivers/staging/rtl8723bs/include/hal_intf.h
+++ b/drivers/staging/rtl8723bs/include/hal_intf.h
@@ -252,7 +252,7 @@ c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter);
s32 rtw_hal_macid_sleep(struct adapter *padapter, u32 macid);
s32 rtw_hal_macid_wakeup(struct adapter *padapter, u32 macid);
-s32 rtw_hal_fill_h2c_cmd(struct adapter *, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
+s32 rtw_hal_fill_h2c_cmd(struct adapter *adapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
void SetHwReg8723BS(struct adapter *padapter, u8 variable, u8 *val);
void GetHwReg8723BS(struct adapter *padapter, u8 variable, u8 *val);
diff --git a/drivers/staging/rtl8723bs/include/rtw_btcoex.h b/drivers/staging/rtl8723bs/include/rtw_btcoex.h
index 19764c80b8ba..9fbb145c8d45 100644
--- a/drivers/staging/rtl8723bs/include/rtw_btcoex.h
+++ b/drivers/staging/rtl8723bs/include/rtw_btcoex.h
@@ -15,14 +15,14 @@
#define PACKET_ARP 2
#define PACKET_EAPOL 3
-void rtw_btcoex_MediaStatusNotify(struct adapter *, u8 mediaStatus);
-void rtw_btcoex_HaltNotify(struct adapter *);
+void rtw_btcoex_MediaStatusNotify(struct adapter *adapter, u8 mediaStatus);
+void rtw_btcoex_HaltNotify(struct adapter *adapter);
/* ================================================== */
/* Below Functions are called by BT-Coex */
/* ================================================== */
-void rtw_btcoex_RejectApAggregatedPacket(struct adapter *, u8 enable);
-void rtw_btcoex_LPS_Enter(struct adapter *);
-void rtw_btcoex_LPS_Leave(struct adapter *);
+void rtw_btcoex_RejectApAggregatedPacket(struct adapter *adapter, u8 enable);
+void rtw_btcoex_LPS_Enter(struct adapter *adapter);
+void rtw_btcoex_LPS_Leave(struct adapter *adapter);
#endif /* __RTW_BTCOEX_H__ */
diff --git a/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h b/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h
index c27d07861b8c..df5dbcceea06 100644
--- a/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h
+++ b/drivers/staging/rtl8723bs/include/rtw_pwrctrl.h
@@ -215,8 +215,8 @@ struct pwrctrl_priv {
extern void rtw_init_pwrctrl_priv(struct adapter *adapter);
extern void rtw_free_pwrctrl_priv(struct adapter *adapter);
-s32 rtw_register_task_alive(struct adapter *, u32 task);
-void rtw_unregister_task_alive(struct adapter *, u32 task);
+s32 rtw_register_task_alive(struct adapter *adapter, u32 task);
+void rtw_unregister_task_alive(struct adapter *adapter, u32 task);
extern s32 rtw_register_tx_alive(struct adapter *padapter);
extern void rtw_unregister_tx_alive(struct adapter *padapter);
extern s32 rtw_register_cmd_alive(struct adapter *padapter);
--
2.48.1
^ permalink raw reply related
* [PATCH] staging: rtl8723bs: remove unnecessary braces in rtl8723b_hal_init.c
From: Atharv Margur @ 2026-05-23 14:13 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Atharv Margur
Remove unnecessary braces around single statement blocks
to improve readability and conform to kernel coding style.
No functional changes intended.
Signed-off-by: Atharv Margur <atharvmargur@gmail.com>
---
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 22 +++++++------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index e794fe3ca..14ec258c0 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -197,9 +197,8 @@ static s32 polling_fwdl_chksum(
yield();
} while (jiffies_to_msecs(jiffies-start) < timeout_ms || cnt < min_cnt);
- if (!(value32 & FWDL_ChkSum_rpt)) {
+ if (!(value32 & FWDL_ChkSum_rpt))
goto exit;
- }
if (g_fwdl_chksum_fail) {
g_fwdl_chksum_fail--;
@@ -238,9 +237,8 @@ static s32 _FWFreeToGo(struct adapter *adapter, u32 min_cnt, u32 timeout_ms)
yield();
} while (jiffies_to_msecs(jiffies - start) < timeout_ms || cnt < min_cnt);
- if (!(value32 & WINTINI_RDY)) {
+ if (!(value32 & WINTINI_RDY))
goto exit;
- }
if (g_fwdl_wintint_rdy_fail) {
g_fwdl_wintint_rdy_fail--;
@@ -1048,9 +1046,8 @@ void UpdateHalRAMask8723B(struct adapter *padapter, u32 mac_id, u8 rssi_level)
rate_bitmap = hal_btcoex_GetRaMask(padapter);
mask &= ~rate_bitmap;
- if (pHalData->fw_ractrl) {
+ if (pHalData->fw_ractrl)
rtl8723b_set_FwMacIdConfig_cmd(padapter, mac_id, psta->raid, psta->bw_mode, short_gi_rate, mask);
- }
/* set correct initial date rate for each mac_id */
pdmpriv->INIDATA_RATE[mac_id] = psta->init_rate;
@@ -1621,9 +1618,8 @@ static void rtl8723b_cal_txdesc_chksum(struct tx_desc *ptxdesc)
/* Thomas, Lucas@SD4, 20130515 */
count = 16;
- for (index = 0; index < count; index++) {
+ for (index = 0; index < count; index++)
checksum |= le16_to_cpu(*(__le16 *)(usPtr + index));
- }
ptxdesc->txdw7 |= cpu_to_le32(checksum & 0x0000ffff);
}
@@ -1892,9 +1888,8 @@ void rtl8723b_fill_fake_txdesc(
SET_TX_DESC_HWSEQ_SEL_8723B(pDesc, 0);
}
- if (IsBTQosNull) {
+ if (IsBTQosNull)
SET_TX_DESC_BT_INT_8723B(pDesc, 1);
- }
SET_TX_DESC_USE_RATE_8723B(pDesc, 1); /* use data rate which is set by Sw */
SET_TX_DESC_OWN_8723B((u8 *)pDesc, 1);
@@ -2211,9 +2206,9 @@ void CCX_FwC2HTxRpt_8723b(struct adapter *padapter, u8 *pdata, u8 len)
#define GET_8723B_C2H_TX_RPT_LIFE_TIME_OVER(_Header) LE_BITS_TO_1BYTE((_Header + 0), 6, 1)
#define GET_8723B_C2H_TX_RPT_RETRY_OVER(_Header) LE_BITS_TO_1BYTE((_Header + 0), 7, 1)
- if (GET_8723B_C2H_TX_RPT_RETRY_OVER(pdata) | GET_8723B_C2H_TX_RPT_LIFE_TIME_OVER(pdata)) {
+ if (GET_8723B_C2H_TX_RPT_RETRY_OVER(pdata) | GET_8723B_C2H_TX_RPT_LIFE_TIME_OVER(pdata))
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_CCX_PKT_FAIL);
- }
+
/*
else if (seq_no != padapter->xmitpriv.seq_no) {
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_CCX_PKT_FAIL);
@@ -2583,9 +2578,8 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val)
/* Forece leave RF low power mode for 1T1R to prevent conficting setting in Fw power */
/* saving sequence. 2010.06.07. Added by tynli. Suggested by SD3 yschang. */
- if (psmode != PS_MODE_ACTIVE) {
+ if (psmode != PS_MODE_ACTIVE)
ODM_RF_Saving(&pHalData->odmpriv, true);
- }
/* if (psmode != PS_MODE_ACTIVE) { */
/* rtl8723b_set_lowpwr_lps_cmd(padapter, true); */
--
2.53.0
^ permalink raw reply related
* Re: [PATCH v7] staging: rtl8723bs: fix remote heap info disclosure and OOB reads
From: Greg Kroah-Hartman @ 2026-05-23 13:44 UTC (permalink / raw)
To: luka.gejak; +Cc: linux-staging, linux-kernel, stable
In-Reply-To: <20260523131331.69768-1-luka.gejak@linux.dev>
On Sat, May 23, 2026 at 03:13:31PM +0200, luka.gejak@linux.dev wrote:
> From: Luka Gejak <luka.gejak@linux.dev>
>
> When building an association request frame, the driver iterates over
> the ies received from the ap. In several places, the driver trusts the
> attacker-controlled pIE->length without validating that it meets the
> minimum expected size for the respective ie.
>
> For WLAN_EID_HT_CAPABILITY, this causes an oob read of adjacent heap
> memory which is then transmitted over the air (remote heap information
> disclosure). For WLAN_EID_VENDOR_SPECIFIC, it causes two separate oob
> reads: one when checking the 4-byte oui, and another when copying the
> 14-byte wps ie.
>
> Fix these issues by adding upper-bound checks at the start of the loop
> to ensure the ie fits within the buffer, and explicit lower-bound
> checks to return a failure if the length is insufficient. For
> HT_CAPABILITY, also clamp the length passed to rtw_set_ie() to the
> struct size.
>
> Also fix three additional issues discovered during review:
> - Missing free of pmgntframe and its xmitbuf before jumping to exit
> in the WLAN_EID_VENDOR_SPECIFIC lower-bound checks.
> - In is_ap_in_tkip(), add missing lower-bound checks for the RSN and
> vendor-specific IE data accesses (pre-existing bug).
> - Move rtw_buf_update() before dump_mgntframe() to avoid a potential
> use-after-free of pwlanhdr, which points into the mgmt frame buffer
> (pre-existing bug).
When you say "also" that implies you need to break this patch up into
smaller pieces, right? Please do so.
>
> Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
> ---
> Changes in v7:
> - Address new sashiko comments.
>
That does not say _what_ you did, only that you did _something_. Please
be more specific.
thanks,
greg k-h
^ permalink raw reply
* [PATCH v7] staging: rtl8723bs: fix remote heap info disclosure and OOB reads
From: luka.gejak @ 2026-05-23 13:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Luka Gejak, stable
From: Luka Gejak <luka.gejak@linux.dev>
When building an association request frame, the driver iterates over
the ies received from the ap. In several places, the driver trusts the
attacker-controlled pIE->length without validating that it meets the
minimum expected size for the respective ie.
For WLAN_EID_HT_CAPABILITY, this causes an oob read of adjacent heap
memory which is then transmitted over the air (remote heap information
disclosure). For WLAN_EID_VENDOR_SPECIFIC, it causes two separate oob
reads: one when checking the 4-byte oui, and another when copying the
14-byte wps ie.
Fix these issues by adding upper-bound checks at the start of the loop
to ensure the ie fits within the buffer, and explicit lower-bound
checks to return a failure if the length is insufficient. For
HT_CAPABILITY, also clamp the length passed to rtw_set_ie() to the
struct size.
Also fix three additional issues discovered during review:
- Missing free of pmgntframe and its xmitbuf before jumping to exit
in the WLAN_EID_VENDOR_SPECIFIC lower-bound checks.
- In is_ap_in_tkip(), add missing lower-bound checks for the RSN and
vendor-specific IE data accesses (pre-existing bug).
- Move rtw_buf_update() before dump_mgntframe() to avoid a potential
use-after-free of pwlanhdr, which points into the mgmt frame buffer
(pre-existing bug).
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@vger.kernel.org
Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
---
Changes in v7:
- Address new sashiko comments.
Changes in v6:
- Restore full changes history.
Changes in v5:
- Address sashiko comments.
Changes in v4:
- Added upper-bound checks at the start of the loop to ensure the ie
fits within the received buffer, as pointed out by Dan.
- Updated commit message to reflect the addition of upper-bound checks.
Changes in v3:
- Switched to fail-fast handling for malformed IEs in issue_assocreq().
- Fixed HT capability path to use structure-sized output length in
rtw_set_ie().
- Updated commit message to reflect all oob read cases.
Changes in v2:
- Refactored rtw_set_ie() alignment to follow "open parenthesis" style.
- Allowed the line length to exceed 100 characters for better
readability as requested by Greg KH.
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 43 +++++++++++++++++--
.../staging/rtl8723bs/core/rtw_wlan_util.c | 13 +++++-
2 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index a86d6f97cf02..43112d14f619 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -2826,6 +2826,9 @@ void issue_assocreq(struct adapter *padapter)
if (pmlmeinfo->network.supported_rates[i] == 0)
break;
+ if (index >= NumRates)
+ break;
+
/* Check if the AP's supported rates are also supported by STA. */
for (j = 0; j < sta_bssrate_len; j++) {
/* Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP */
@@ -2855,10 +2858,28 @@ void issue_assocreq(struct adapter *padapter)
/* vendor specific IE, such as WPA, WMM, WPS */
for (i = sizeof(struct ndis_802_11_fix_ie); i < pmlmeinfo->network.ie_length;) {
+ if (i + 2 > pmlmeinfo->network.ie_length) {
+ rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf);
+ rtw_free_xmitframe(pxmitpriv, pmgntframe);
+ goto exit;
+ }
+
pIE = (struct ndis_80211_var_ie *)(pmlmeinfo->network.ies + i);
+ if (pIE->length > pmlmeinfo->network.ie_length - i - 2) {
+ rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf);
+ rtw_free_xmitframe(pxmitpriv, pmgntframe);
+ goto exit;
+ }
+
switch (pIE->element_id) {
case WLAN_EID_VENDOR_SPECIFIC:
+ if (pIE->length < 4) {
+ rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf);
+ rtw_free_xmitframe(pxmitpriv, pmgntframe);
+ goto exit;
+ }
+
if ((!memcmp(pIE->data, RTW_WPA_OUI, 4)) ||
(!memcmp(pIE->data, WMM_OUI, 4)) ||
(!memcmp(pIE->data, WPS_OUI, 4))) {
@@ -2870,6 +2891,12 @@ void issue_assocreq(struct adapter *padapter)
* extensions information to AP
*/
+ if (pIE->length < 14) {
+ rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf);
+ rtw_free_xmitframe(pxmitpriv, pmgntframe);
+ goto exit;
+ }
+
vs_ie_length = 14;
}
@@ -2883,8 +2910,17 @@ void issue_assocreq(struct adapter *padapter)
case WLAN_EID_HT_CAPABILITY:
if (padapter->mlmepriv.htpriv.ht_option) {
if (!(is_ap_in_tkip(padapter))) {
+ if (pIE->length < sizeof(struct HT_caps_element)) {
+ rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf);
+ rtw_free_xmitframe(pxmitpriv, pmgntframe);
+ goto exit;
+ }
+
memcpy(&(pmlmeinfo->HT_caps), pIE->data, sizeof(struct HT_caps_element));
- pframe = rtw_set_ie(pframe, WLAN_EID_HT_CAPABILITY, pIE->length, (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen));
+ pframe = rtw_set_ie(pframe, WLAN_EID_HT_CAPABILITY,
+ sizeof(struct HT_caps_element),
+ (u8 *)&pmlmeinfo->HT_caps,
+ &pattrib->pktlen);
}
}
break;
@@ -2903,15 +2939,14 @@ void issue_assocreq(struct adapter *padapter)
if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK)
pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, 6, REALTEK_96B_IE, &(pattrib->pktlen));
+ rtw_buf_update(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len, (u8 *)pwlanhdr, pattrib->pktlen);
pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe);
ret = _SUCCESS;
exit:
- if (ret == _SUCCESS)
- rtw_buf_update(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len, (u8 *)pwlanhdr, pattrib->pktlen);
- else
+ if (ret != _SUCCESS)
rtw_buf_free(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len);
}
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 1d37c2d5b10d..b8e88aaad897 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -1301,17 +1301,26 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
for (i = sizeof(struct ndis_802_11_fix_ie); i < pmlmeinfo->network.ie_length;) {
+ if (i + 2 > pmlmeinfo->network.ie_length)
+ return false;
+
pIE = (struct ndis_80211_var_ie *)(pmlmeinfo->network.ies + i);
+ if (pIE->length > pmlmeinfo->network.ie_length - i - 2)
+ return false;
+
switch (pIE->element_id) {
case WLAN_EID_VENDOR_SPECIFIC:
- if ((!memcmp(pIE->data, RTW_WPA_OUI, 4)) && (!memcmp((pIE->data + 12), WPA_TKIP_CIPHER, 4)))
+ if (pIE->length >= 16 &&
+ (!memcmp(pIE->data, RTW_WPA_OUI, 4)) &&
+ (!memcmp((pIE->data + 12), WPA_TKIP_CIPHER, 4)))
return true;
break;
case WLAN_EID_RSN:
- if (!memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4))
+ if (pIE->length >= 12 &&
+ !memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4))
return true;
break;
--
2.54.0
^ permalink raw reply related
* Re: [PATCH v2] staging: rtl8723bs: remove unnecessary boolean comparisons in rtw_recv.c
From: Andrei Khomenkov @ 2026-05-23 12:34 UTC (permalink / raw)
To: Ashwin Gundarapu; +Cc: gregkh, linux-kernel, linux-staging
In-Reply-To: <19e546f7b7d.2192aa4a49317.2370843901367566351@zohomail.in>
On Sat, May 23, 2026 at 04:14:12PM +0530, Ashwin Gundarapu wrote:
> Remove explicit comparisons to true and false. Replace '== false'
> with the '!' operator and remove '== true' entirely.
>
> Found by checkpatch.pl --strict
>
> Signed-off-by: Ashwin Gundarapu <linuxuser509@zohomail.in>
> ---
> v2: Reverted unrelated else/break change as pointed out by Dan Carpenter.
> ---
> drivers/staging/rtl8723bs/core/rtw_recv.c | 56 +++++++++++------------
> 1 file changed, 27 insertions(+), 29 deletions(-)
This patch doesn't apply to the staging-next tree.
I have recently done a massive cleanup of this driver and removed
these boolean comparisons. So please rebase your local tree and check
if there is anything left that is worth your effort.
Regards,
Andrei
^ permalink raw reply
* [PATCH 4/4] staging: rtl8723bs: fix indentation of closing brace
From: Oliwier Iwan @ 2026-05-23 12:30 UTC (permalink / raw)
To: linux-staging; +Cc: gregkh, straube.linux, linux-kernel, Oliwier Iwan
In-Reply-To: <20260523123043.22907-1-oliwieriwan@mailbox.org>
Fix misaligned closing brace in SetHalODMVar to use
tabs instead of spaces for correct indentation.
Signed-off-by: Oliwier Iwan <oliwieriwan@mailbox.org>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 665bfec5ffdd..4b4bfa80e37c 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -736,7 +736,7 @@ void SetHalODMVar(
ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, NULL);
/* spin_unlock_bh(&pHalData->odm_stainfo_lock); */
- }
+ }
}
break;
case HAL_ODM_P2P_STATE:
--
2.54.0
^ permalink raw reply related
* [PATCH 2/4] staging: rtl8723bs: remove space before tab in block comments
From: Oliwier Iwan @ 2026-05-23 12:30 UTC (permalink / raw)
To: linux-staging; +Cc: gregkh, straube.linux, linux-kernel, Oliwier Iwan
In-Reply-To: <20260523123043.22907-1-oliwieriwan@mailbox.org>
Remove the extra space before tab in the BK/BE/VI/VO queue
mapping comments to fix checkpatch warnings.
Signed-off-by: Oliwier Iwan <oliwieriwan@mailbox.org>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 5473dca13695..1130511859ab 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -362,7 +362,7 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
if (bWIFICfg) { /* WMM */
- /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
+ /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 0, 1, 0, 1, 0, 0, 0, 0, 0 }; */
/* 0:ep_0 num, 1:ep_1 num */
@@ -403,7 +403,7 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
if (bWIFICfg) { /* for WMM */
- /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
+ /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 1, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
@@ -420,7 +420,7 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
} else { /* typical setting */
- /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
+ /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
/* 2, 2, 1, 0, 0, 0, 0, 0, 0 }; */
/* 0:H, 1:N, 2:L */
--
2.54.0
^ permalink raw reply related
* [PATCH 1/4] staging: rtl8723bs: fix comparison in hal_com_config_channel_plan
From: Oliwier Iwan @ 2026-05-23 12:30 UTC (permalink / raw)
To: linux-staging; +Cc: gregkh, straube.linux, linux-kernel, Oliwier Iwan
Place the constant on the right side of the comparison as preferred
by the kernel coding style.
Signed-off-by: Oliwier Iwan <oliwieriwan@mailbox.org>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 728a2171fbcb..5473dca13695 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -107,7 +107,7 @@ u8 hal_com_config_channel_plan(
pHalData->bDisableSWChannelPlan = false;
chnlPlan = def_channel_plan;
- if (0xFF == hw_channel_plan)
+ if (hw_channel_plan == 0xFF)
auto_load_fail = true;
if (!auto_load_fail) {
--
2.54.0
^ permalink raw reply related
* [PATCH 3/4] staging: rtl8723bs: align '*' on each line of block comments
From: Oliwier Iwan @ 2026-05-23 12:30 UTC (permalink / raw)
To: linux-staging; +Cc: gregkh, straube.linux, linux-kernel, Oliwier Iwan
In-Reply-To: <20260523123043.22907-1-oliwieriwan@mailbox.org>
Add missing space before '*' on each line of block comments
to fix checkpatch warnings.
Signed-off-by: Oliwier Iwan <oliwieriwan@mailbox.org>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 28 ++++++++++++-------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 1130511859ab..665bfec5ffdd 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -478,10 +478,10 @@ void rtw_init_hal_com_default_value(struct adapter *Adapter)
}
/*
-* C2H event format:
-* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
-* BITS [127:120] [119:16] [15:8] [7:4] [3:0]
-*/
+ * C2H event format:
+ * Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
+ * BITS [127:120] [119:16] [15:8] [7:4] [3:0]
+ */
void c2h_evt_clear(struct adapter *adapter)
{
@@ -489,10 +489,10 @@ void c2h_evt_clear(struct adapter *adapter)
}
/*
-* C2H event format:
-* Field TRIGGER CMD_LEN CONTENT CMD_SEQ CMD_ID
-* BITS [127:120] [119:112] [111:16] [15:8] [7:0]
-*/
+ * C2H event format:
+ * Field TRIGGER CMD_LEN CONTENT CMD_SEQ CMD_ID
+ * BITS [127:120] [119:112] [111:16] [15:8] [7:0]
+ */
s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf)
{
s32 ret = _FAIL;
@@ -526,9 +526,9 @@ s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf)
clear_evt:
/*
- * Clear event to notify FW we have read the command.
- * If this field isn't clear, the FW won't update the next command message.
- */
+ * Clear event to notify FW we have read the command.
+ * If this field isn't clear, the FW won't update the next command message.
+ */
c2h_evt_clear(adapter);
exit:
return ret;
@@ -625,9 +625,9 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
break;
case HW_VAR_DM_FUNC_CLR:
/*
- * input is already a mask to clear function
- * don't invert it again! George, Lucas@20130513
- */
+ * input is already a mask to clear function
+ * don't invert it again! George, Lucas@20130513
+ */
odm->SupportAbility &= *((u32 *)val);
break;
case HW_VAR_AMPDU_MIN_SPACE:
--
2.54.0
^ permalink raw reply related
* [PATCH] staging: media: atomisp: fix typo in rx.c
From: Marlon Trujillo @ 2026-05-23 11:15 UTC (permalink / raw)
To: hansg, mchehab, gregkh
Cc: sakari.ailus, andy, linux-media, linux-staging, linux-kernel
Fix spelling mistake: inptu -> input
Signed-off-by: Marlon Trujillo <marl0rd1080@gmail.com>
---
drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c b/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c
index 9cfb8bc97e24..ce7035ce8606 100644
--- a/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c
+++ b/drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c
@@ -55,7 +55,7 @@ void ia_css_isys_rx_enable_all_interrupts(enum mipi_port_id port)
* */
enum mipi_port_id ia_css_isys_port_to_mipi_port(enum mipi_port_id api_port)
{
- /* In this module the validity of the inptu variable should
+ /* In this module the validity of the input variable should
* have been checked already, so we do not check for erroneous
* values. */
enum mipi_port_id port = MIPI_PORT0_ID;
--
2.47.3
^ permalink raw reply related
* [PATCH v2] staging: rtl8723bs: remove unnecessary boolean comparisons in rtw_recv.c
From: Ashwin Gundarapu @ 2026-05-23 10:44 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-staging
Remove explicit comparisons to true and false. Replace '== false'
with the '!' operator and remove '== true' entirely.
Found by checkpatch.pl --strict
Signed-off-by: Ashwin Gundarapu <linuxuser509@zohomail.in>
---
v2: Reverted unrelated else/break change as pointed out by Dan Carpenter.
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 56 +++++++++++------------
1 file changed, 27 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index f78194d508df..011dbd8e2a77 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -382,7 +382,7 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p
/* psecuritypriv->dot118021XGrpKeyid, pmlmeinfo->key_index, rxdata_key_idx); */
- if (psecuritypriv->binstallGrpkey == false) {
+ if (!psecuritypriv->binstallGrpkey) {
res = _FAIL;
goto exit;
}
@@ -406,10 +406,10 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p
}
- if (bmic_err == true) {
+ if (bmic_err) {
/* double check key_index for some timing issue , */
/* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue */
- if ((is_multicast_ether_addr(prxattrib->ra) == true) && (prxattrib->key_index != pmlmeinfo->key_index))
+ if ((is_multicast_ether_addr(prxattrib->ra)) && (prxattrib->key_index != pmlmeinfo->key_index))
brpt_micerror = false;
if (prxattrib->bdecrypted && brpt_micerror)
@@ -463,7 +463,7 @@ static union recv_frame *decryptor(struct adapter *padapter, union recv_frame *p
}
}
- if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) || (psecuritypriv->sw_decrypt == true))) {
+ if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) || (psecuritypriv->sw_decrypt))) {
psecuritypriv->hw_decrypted = false;
switch (prxattrib->encrypt) {
@@ -713,8 +713,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
u8 *sta_addr = NULL;
signed int bmcast = is_multicast_ether_addr(pattrib->dst);
- if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
- (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
+ if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) ||
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
/* filter packets that SA is myself or multicast or broadcast */
if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
@@ -736,7 +736,7 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
sta_addr = pattrib->src;
- } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
+ } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
/* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */
if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN)) {
ret = _FAIL;
@@ -744,7 +744,7 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
}
sta_addr = pattrib->bssid;
- } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+ } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
if (bmcast) {
/* For AP mode, if DA == MCAST, then BSSID should be also MCAST */
if (!is_multicast_ether_addr(pattrib->bssid)) {
@@ -761,7 +761,7 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
sta_addr = pattrib->src;
}
- } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) {
+ } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
@@ -800,9 +800,9 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
u8 *myhwaddr = myid(&adapter->eeprompriv);
signed int bmcast = is_multicast_ether_addr(pattrib->dst);
- if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) &&
- (check_fwstate(pmlmepriv, _FW_LINKED) == true ||
- check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
+ if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE)) &&
+ (check_fwstate(pmlmepriv, _FW_LINKED) ||
+ check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
) {
/* filter packets that SA is myself or multicast or broadcast */
@@ -847,8 +847,8 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
goto exit;
}
- } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
- (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
+ } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) &&
+ (check_fwstate(pmlmepriv, _FW_LINKED))) {
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
@@ -866,7 +866,7 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
}
- } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+ } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* Special case */
ret = RTW_RX_HANDLED;
goto exit;
@@ -903,7 +903,7 @@ static signed int sta2ap_data_frame(struct adapter *adapter, union recv_frame *p
unsigned char *mybssid = get_bssid(pmlmepriv);
signed int ret = _SUCCESS;
- if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+ if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* For AP mode, RA =BSSID, TX =STA(SRC_ADDR), A3 =DST_ADDR */
if (memcmp(pattrib->bssid, mybssid, ETH_ALEN)) {
ret = _FAIL;
@@ -1597,7 +1597,7 @@ static signed int wlanhdr_to_ethhdr(union recv_frame *precvframe)
eth_type = ntohs(be_tmp); /* pattrib->ether_type */
pattrib->eth_type = eth_type;
- if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)) {
+ if ((check_fwstate(pmlmepriv, WIFI_MP_STATE))) {
ptr += rmv_len;
*ptr = 0x87;
*(ptr + 1) = 0x12;
@@ -1950,8 +1950,8 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
/* indicate this recv_frame */
if (!pattrib->amsdu) {
- if ((padapter->bDriverStopped == false) &&
- (padapter->bSurpriseRemoved == false))
+ if (!padapter->bDriverStopped &&
+ !padapter->bSurpriseRemoved)
rtw_recv_indicatepkt(padapter, prframe);/* indicate this recv_frame */
} else if (pattrib->amsdu == 1) {
@@ -1991,8 +1991,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
wlanhdr_to_ethhdr(prframe);
if (pattrib->qos != 1) {
- if ((padapter->bDriverStopped == false) &&
- (padapter->bSurpriseRemoved == false)) {
+ if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
rtw_recv_indicatepkt(padapter, prframe);
return _SUCCESS;
@@ -2002,7 +2001,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
}
- if (preorder_ctrl->enable == false) {
+ if (!preorder_ctrl->enable) {
/* indicate this recv_frame */
preorder_ctrl->indicate_seq = pattrib->seq_num;
@@ -2013,7 +2012,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
return _SUCCESS;
}
} else if (pattrib->amsdu == 1) { /* temp filter -> means didn't support A-MSDUs in a A-MPDU */
- if (preorder_ctrl->enable == false) {
+ if (!preorder_ctrl->enable) {
preorder_ctrl->indicate_seq = pattrib->seq_num;
retval = amsdu_to_msdu(padapter, prframe);
@@ -2099,8 +2098,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame
if (recv_indicatepkt_reorder(padapter, prframe) != _SUCCESS) { /* including perform A-MPDU Rx Ordering Buffer Control */
- if ((padapter->bDriverStopped == false) &&
- (padapter->bSurpriseRemoved == false)) {
+ if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
retval = _FAIL;
return retval;
}
@@ -2110,7 +2108,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame
if (retval != _SUCCESS)
return retval;
- if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) {
+ if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
/* indicate this recv_frame */
rtw_recv_indicatepkt(padapter, prframe);
} else {
@@ -2199,7 +2197,7 @@ static int recv_func(struct adapter *padapter, union recv_frame *rframe)
/* check if need to enqueue into uc_swdec_pending_queue*/
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
!is_multicast_ether_addr(prxattrib->ra) && prxattrib->encrypt > 0 &&
- (prxattrib->bdecrypted == 0 || psecuritypriv->sw_decrypt == true) &&
+ (!prxattrib->bdecrypted || psecuritypriv->sw_decrypt) &&
psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPAPSK &&
!psecuritypriv->busetkipkey) {
rtw_enqueue_recvframe(rframe, &padapter->recvpriv.uc_swdec_pending_queue);
@@ -2286,8 +2284,8 @@ static void rtw_signal_stat_timer_hdl(struct timer_list *t)
}
}
- if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == true ||
- check_fwstate(&adapter->mlmepriv, _FW_LINKED) == false
+ if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) ||
+ !check_fwstate(&adapter->mlmepriv, _FW_LINKED)
) {
goto set_timer;
}
--
2.43.0
^ permalink raw reply related
* Re: [PATCH v2] staging: greybus: audio: expect 0 from kstrtoint(), not 1
From: Dan Carpenter @ 2026-05-23 10:33 UTC (permalink / raw)
To: Alexander A. Klimov
Cc: Vaibhav Agarwal, Mark Greer, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, Elise Lennion,
moderated list:GREYBUS SUBSYSTEM, open list:STAGING SUBSYSTEM,
open list
In-Reply-To: <20260522055344.38733-1-grandmaster@al2klimov.de>
On Fri, May 22, 2026 at 07:53:43AM +0200, Alexander A. Klimov wrote:
> kstrtoint() returns "0 on success, -ERANGE on overflow
> and -EINVAL on parsing error". In contrast,
> manager_sysfs_remove_store() and manager_sysfs_dump_store()
> checked for 1 which always failed the operation. I fixed this.
>
> Fixes: f9a21a3f4919 ("staging: greybus: audio_manager_sysfs: Replace sscanf with kstrto* to single variable conversion.")
> Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
> ---
> v2: style (X,!X instead of X!=0,X==0)
>
> drivers/staging/greybus/audio_manager_sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c
> index fcd518f9540c..581791d566e3 100644
> --- a/drivers/staging/greybus/audio_manager_sysfs.c
> +++ b/drivers/staging/greybus/audio_manager_sysfs.c
> @@ -44,7 +44,7 @@ static ssize_t manager_sysfs_remove_store(struct kobject *kobj,
>
> int num = kstrtoint(buf, 10, &id);
>
> - if (num != 1)
> + if (num)
> return -EINVAL;
Really num is the wrong name. It should be ret. Also the declaration
should be at the start of the function... :/
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 1/2] staging: rtl8723bs: remove dead rtw_atimdone_event_callback()
From: Dan Carpenter @ 2026-05-23 10:32 UTC (permalink / raw)
To: Andrei Khomenkov; +Cc: Greg Kroah-Hartman, linux-staging
In-Reply-To: <20260522190256.49830-2-khomenkov@mailbox.org>
On Fri, May 22, 2026 at 10:02:55PM +0300, Andrei Khomenkov wrote:
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> index a86d6f97cf02..c56082cd5264 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> @@ -5619,7 +5619,7 @@ static struct fwevent wlanevents[] = {
> {0, &rtw_joinbss_event_callback}, /*10*/
> {sizeof(struct stassoc_event), &rtw_stassoc_event_callback},
> {sizeof(struct stadel_event), &rtw_stadel_event_callback},
> - {0, &rtw_atimdone_event_callback},
> + {0, rtw_dummy_event_callback},
> {0, rtw_dummy_event_callback},
> {0, NULL}, /*15*/
> {0, NULL},
This patch is fine...
Reviewed-by: Dan Carpenter <error27@gmail.com>
But, dummy functions are really discouraged. It's supposed to be that
the caller checks for NULL and then doesn't call it. No point in having
a do nothing dummy function when we could just store a NULL pointer there
instead.
And most of that table is NULL pointers! I looked at the callers and
it's alarming that I don't immediately see any NULL checks.
5657 /* checking if event size match the event parm size */
5658 if ((wlanevents[evt_code].parmsize != 0) &&
If the callback is NULL then parmsize is 0 so we don't care about the
size... Just continue.
5659 (wlanevents[evt_code].parmsize != evt_sz))
5660 goto _abort_event_;
5661
5662 atomic_inc(&pevt_priv->event_seq);
5663
5664 peventbuf += 2;
5665
5666 if (peventbuf) {
5667 event_callback = wlanevents[evt_code].event_callback;
Get the call back.
5668 event_callback(padapter, (u8 *)peventbuf);
And crash... I guess we are relying on this table to be in sync with
the wlancmds[] table in drivers/staging/rtl8723bs/core/rtw_cmd.c.
That seems pretty risky to me.
5669
5670 pevt_priv->evt_done_cnt++;
5671 }
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] staging: rtl8723bs: remove unnecessary boolean comparisons in rtw_recv.c
From: Dan Carpenter @ 2026-05-23 10:23 UTC (permalink / raw)
To: Ashwin Gundarapu; +Cc: gregkh, linux-staging, linux-kernel
In-Reply-To: <19e53a283b8.4f2498e045168.7106069608127124839@zohomail.in>
On Sat, May 23, 2026 at 12:30:20PM +0530, Ashwin Gundarapu wrote:
> @@ -1841,8 +1841,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
> /* Duplicate entry is found!! Do not insert current entry. */
> /* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
> return false;
> - else
> - break;
> + break;
>
> }
This is a bug. You have to think about what checkpatch says instead of
following it blindly. Also it's unrelated to the patch description.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 4/5] staging: sm750fb: use ARRAY_SIZE macro in fb_find_mode loop
From: Dan Carpenter @ 2026-05-23 10:07 UTC (permalink / raw)
To: Ahmet Sezgin Duran; +Cc: gregkh, linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <20260523051509.166152-5-ahmet@sezginduran.net>
On Sat, May 23, 2026 at 05:15:08AM +0000, Ahmet Sezgin Duran wrote:
> The loop in lynxfb_set_fbinfo() iterates over pdb[] and cdb[] using
> a hardcoded bound of 3.
>
> Replace it with ARRAY_SIZE(pdb) so the bound tracks the array.
I don't love this. As you mentioned, there are two arrays and they
both have 3 elements. Why prefer one over the other? This patch
makes the code look simpler than it really is. I would just leave
it as 3.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] staging: greybus: audio: expect 0 from kstrtoint(), not 1
From: Dan Carpenter @ 2026-05-23 9:50 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Alexander A. Klimov, Vaibhav Agarwal, Mark Greer, Johan Hovold,
Alex Elder, Elise Lennion, moderated list:GREYBUS SUBSYSTEM,
open list:STAGING SUBSYSTEM, open list
In-Reply-To: <2026052249-shrank-trophy-14ff@gregkh>
On Fri, May 22, 2026 at 07:07:10AM +0200, Greg Kroah-Hartman wrote:
> > total: 1 errors, 0 warnings, 0 checks, 16 lines checked
> >
> > NOTE: For some of the reported defects, checkpatch may be able to
> > mechanically convert to the typical style using --fix or --fix-inplace.
>
> What about trying --strict?
>
> Anyway, think about rewriting the check for "== 0" now, that is not
> normal kernel style.
The checkpatch rules is only for NULL. You're, of course, right that
== 0 is bad style here but there are be times where it is idiomatic to
check for == 0 or != 0.
I only bring this up to promote my blog.
https://staticthinking.wordpress.com/2024/02/20/when-to-use-0/
#SEO
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] staging: rtl8723bs: remove unnecessary boolean comparisons in rtw_recv.c
From: Ahmet Sezgin Duran @ 2026-05-23 8:27 UTC (permalink / raw)
To: Ashwin Gundarapu, gregkh; +Cc: linux-staging, linux-kernel
In-Reply-To: <19e53a283b8.4f2498e045168.7106069608127124839@zohomail.in>
On 5/23/26 10:00 AM, Ashwin Gundarapu wrote:
> From: Ashwin Gundarapu <linuxuser509@zohomail.in>
> Date: Sat, 23 May 2026 12:28:02 +0530
> Subject: [PATCH] staging: rtl8723bs: remove unnecessary boolean comparisons in
> rtw_recv.c
>
This part should not be in the mail body. Better to use `git send-email`
for sending patches.
Regards,
Ahmet Sezgin Duran
^ permalink raw reply
* [PATCH] staging: rtl8723bs: remove unnecessary boolean comparisons in rtw_recv.c
From: Ashwin Gundarapu @ 2026-05-23 7:00 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel
From: Ashwin Gundarapu <linuxuser509@zohomail.in>
Date: Sat, 23 May 2026 12:28:02 +0530
Subject: [PATCH] staging: rtl8723bs: remove unnecessary boolean comparisons in
rtw_recv.c
Remove explicit comparisons to true and false. Replace '== false'
with the '!' operator and remove '== true' entirely.
Found by checkpatch.pl --strict
Signed-off-by: Ashwin Gundarapu <linuxuser509@zohomail.in>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 59 +++++++++++------------
1 file changed, 28 insertions(+), 31 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index f78194d508df..3289a925bd5a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -382,7 +382,7 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p
/* psecuritypriv->dot118021XGrpKeyid, pmlmeinfo->key_index, rxdata_key_idx); */
- if (psecuritypriv->binstallGrpkey == false) {
+ if (!psecuritypriv->binstallGrpkey) {
res = _FAIL;
goto exit;
}
@@ -406,10 +406,10 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p
}
- if (bmic_err == true) {
+ if (bmic_err) {
/* double check key_index for some timing issue , */
/* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue */
- if ((is_multicast_ether_addr(prxattrib->ra) == true) && (prxattrib->key_index != pmlmeinfo->key_index))
+ if ((is_multicast_ether_addr(prxattrib->ra)) && (prxattrib->key_index != pmlmeinfo->key_index))
brpt_micerror = false;
if (prxattrib->bdecrypted && brpt_micerror)
@@ -463,7 +463,7 @@ static union recv_frame *decryptor(struct adapter *padapter, union recv_frame *p
}
}
- if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) || (psecuritypriv->sw_decrypt == true))) {
+ if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) || (psecuritypriv->sw_decrypt))) {
psecuritypriv->hw_decrypted = false;
switch (prxattrib->encrypt) {
@@ -713,8 +713,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
u8 *sta_addr = NULL;
signed int bmcast = is_multicast_ether_addr(pattrib->dst);
- if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
- (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
+ if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) ||
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
/* filter packets that SA is myself or multicast or broadcast */
if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
@@ -736,7 +736,7 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
sta_addr = pattrib->src;
- } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
+ } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
/* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */
if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN)) {
ret = _FAIL;
@@ -744,7 +744,7 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
}
sta_addr = pattrib->bssid;
- } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+ } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
if (bmcast) {
/* For AP mode, if DA == MCAST, then BSSID should be also MCAST */
if (!is_multicast_ether_addr(pattrib->bssid)) {
@@ -761,7 +761,7 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
sta_addr = pattrib->src;
}
- } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) {
+ } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
@@ -800,9 +800,9 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
u8 *myhwaddr = myid(&adapter->eeprompriv);
signed int bmcast = is_multicast_ether_addr(pattrib->dst);
- if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) &&
- (check_fwstate(pmlmepriv, _FW_LINKED) == true ||
- check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
+ if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE)) &&
+ (check_fwstate(pmlmepriv, _FW_LINKED) ||
+ check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
) {
/* filter packets that SA is myself or multicast or broadcast */
@@ -847,8 +847,8 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
goto exit;
}
- } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
- (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
+ } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) &&
+ (check_fwstate(pmlmepriv, _FW_LINKED))) {
memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
@@ -866,7 +866,7 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
}
- } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+ } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* Special case */
ret = RTW_RX_HANDLED;
goto exit;
@@ -903,7 +903,7 @@ static signed int sta2ap_data_frame(struct adapter *adapter, union recv_frame *p
unsigned char *mybssid = get_bssid(pmlmepriv);
signed int ret = _SUCCESS;
- if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+ if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* For AP mode, RA =BSSID, TX =STA(SRC_ADDR), A3 =DST_ADDR */
if (memcmp(pattrib->bssid, mybssid, ETH_ALEN)) {
ret = _FAIL;
@@ -1597,7 +1597,7 @@ static signed int wlanhdr_to_ethhdr(union recv_frame *precvframe)
eth_type = ntohs(be_tmp); /* pattrib->ether_type */
pattrib->eth_type = eth_type;
- if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)) {
+ if ((check_fwstate(pmlmepriv, WIFI_MP_STATE))) {
ptr += rmv_len;
*ptr = 0x87;
*(ptr + 1) = 0x12;
@@ -1841,8 +1841,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
/* Duplicate entry is found!! Do not insert current entry. */
/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
return false;
- else
- break;
+ break;
}
@@ -1950,8 +1949,8 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
/* indicate this recv_frame */
if (!pattrib->amsdu) {
- if ((padapter->bDriverStopped == false) &&
- (padapter->bSurpriseRemoved == false))
+ if (!padapter->bDriverStopped &&
+ !padapter->bSurpriseRemoved)
rtw_recv_indicatepkt(padapter, prframe);/* indicate this recv_frame */
} else if (pattrib->amsdu == 1) {
@@ -1991,8 +1990,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
wlanhdr_to_ethhdr(prframe);
if (pattrib->qos != 1) {
- if ((padapter->bDriverStopped == false) &&
- (padapter->bSurpriseRemoved == false)) {
+ if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
rtw_recv_indicatepkt(padapter, prframe);
return _SUCCESS;
@@ -2002,7 +2000,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
}
- if (preorder_ctrl->enable == false) {
+ if (!preorder_ctrl->enable) {
/* indicate this recv_frame */
preorder_ctrl->indicate_seq = pattrib->seq_num;
@@ -2013,7 +2011,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
return _SUCCESS;
}
} else if (pattrib->amsdu == 1) { /* temp filter -> means didn't support A-MSDUs in a A-MPDU */
- if (preorder_ctrl->enable == false) {
+ if (!preorder_ctrl->enable) {
preorder_ctrl->indicate_seq = pattrib->seq_num;
retval = amsdu_to_msdu(padapter, prframe);
@@ -2099,8 +2097,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame
if (recv_indicatepkt_reorder(padapter, prframe) != _SUCCESS) { /* including perform A-MPDU Rx Ordering Buffer Control */
- if ((padapter->bDriverStopped == false) &&
- (padapter->bSurpriseRemoved == false)) {
+ if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
retval = _FAIL;
return retval;
}
@@ -2110,7 +2107,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame
if (retval != _SUCCESS)
return retval;
- if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) {
+ if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
/* indicate this recv_frame */
rtw_recv_indicatepkt(padapter, prframe);
} else {
@@ -2199,7 +2196,7 @@ static int recv_func(struct adapter *padapter, union recv_frame *rframe)
/* check if need to enqueue into uc_swdec_pending_queue*/
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
!is_multicast_ether_addr(prxattrib->ra) && prxattrib->encrypt > 0 &&
- (prxattrib->bdecrypted == 0 || psecuritypriv->sw_decrypt == true) &&
+ (!prxattrib->bdecrypted || psecuritypriv->sw_decrypt) &&
psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPAPSK &&
!psecuritypriv->busetkipkey) {
rtw_enqueue_recvframe(rframe, &padapter->recvpriv.uc_swdec_pending_queue);
@@ -2286,8 +2283,8 @@ static void rtw_signal_stat_timer_hdl(struct timer_list *t)
}
}
- if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == true ||
- check_fwstate(&adapter->mlmepriv, _FW_LINKED) == false
+ if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) ||
+ !check_fwstate(&adapter->mlmepriv, _FW_LINKED)
) {
goto set_timer;
}
--
2.43.0
^ permalink raw reply related
* [PATCH v2 1/1] staging: media: tegra-video: vi: Improve media graph building logic
From: Svyatoslav Ryhel @ 2026-05-23 6:47 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Mauro Carvalho Chehab, Hans Verkuil,
Greg Kroah-Hartman, Svyatoslav Ryhel
Cc: linux-media, linux-tegra, linux-staging, linux-kernel
In-Reply-To: <20260523064750.35553-1-clamor95@gmail.com>
The existing tegra_vi_graph_build function relies heavily on a one-to-one
match between Device Tree nodes and media pad links. While this works for
simpler configurations, it causes issues when Device Tree nodes do not
match media pad link logic (e.g., mt9m114). Switch to the
media_entity_get_fwnode_pad helper to verify and retrieve the correct pad
linked to an endpoint, rather than assuming the endpoint ID matches the
pad ID.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/staging/media/tegra-video/vi.c | 78 ++++++++++++--------------
1 file changed, 35 insertions(+), 43 deletions(-)
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index f14cdc7b5211..24e4bd438678 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -1468,7 +1468,6 @@ static int tegra_vi_graph_build(struct tegra_vi_channel *chan,
struct tegra_vi *vi = chan->vi;
struct tegra_vi_graph_entity *ent;
struct fwnode_handle *ep = NULL;
- struct v4l2_fwnode_link link;
struct media_entity *local = entity->entity;
struct media_entity *remote;
struct media_pad *local_pad;
@@ -1478,70 +1477,64 @@ static int tegra_vi_graph_build(struct tegra_vi_channel *chan,
dev_dbg(vi->dev, "creating links for entity %s\n", local->name);
- while (1) {
- ep = fwnode_graph_get_next_endpoint(entity->asd.match.fwnode,
- ep);
- if (!ep)
- break;
+ fwnode_graph_for_each_endpoint(entity->asd.match.fwnode, ep) {
+ struct fwnode_handle *remote_parent __free(fwnode_handle) = NULL;
+ struct fwnode_handle *sink_ep __free(fwnode_handle) = NULL;
+ int src_idx, sink_idx;
- ret = v4l2_fwnode_parse_link(ep, &link);
- if (ret < 0) {
- dev_err(vi->dev, "failed to parse link for %pOF: %d\n",
- to_of_node(ep), ret);
+ src_idx = media_entity_get_fwnode_pad(local, ep,
+ MEDIA_PAD_FL_SOURCE);
+ if (src_idx < 0) {
+ dev_dbg(vi->dev, "no source pad found for %pfw\n", ep);
continue;
}
- if (link.local_port >= local->num_pads) {
- dev_err(vi->dev, "invalid port number %u on %pOF\n",
- link.local_port, to_of_node(link.local_node));
- v4l2_fwnode_put_link(&link);
- ret = -EINVAL;
- break;
+ remote_parent = fwnode_graph_get_remote_port_parent(ep);
+ if (!remote_parent) {
+ dev_dbg(vi->dev, "no remote parent found for %pfw\n",
+ ep);
+ continue;
}
- local_pad = &local->pads[link.local_port];
+ local_pad = &local->pads[src_idx];
/* Remote node is vi node. So use channel video entity and pad
* as remote/sink.
*/
- if (link.remote_node == of_fwnode_handle(vi->dev->of_node)) {
+ if (remote_parent == of_fwnode_handle(vi->dev->of_node)) {
remote = &chan->video.entity;
remote_pad = &chan->pad;
goto create_link;
}
- /*
- * Skip sink ports, they will be processed from the other end
- * of the link.
- */
- if (local_pad->flags & MEDIA_PAD_FL_SINK) {
- dev_dbg(vi->dev, "skipping sink port %pOF:%u\n",
- to_of_node(link.local_node), link.local_port);
- v4l2_fwnode_put_link(&link);
- continue;
- }
-
/* find the remote entity from notifier list */
ent = tegra_vi_graph_find_entity(&chan->notifier.done_list,
- link.remote_node);
+ remote_parent);
if (!ent) {
- dev_err(vi->dev, "no entity found for %pOF\n",
- to_of_node(link.remote_node));
- v4l2_fwnode_put_link(&link);
+ fwnode_handle_put(ep);
+ dev_err(vi->dev, "no entity found for %pfw\n",
+ remote_parent);
ret = -ENODEV;
break;
}
remote = ent->entity;
- if (link.remote_port >= remote->num_pads) {
- dev_err(vi->dev, "invalid port number %u on %pOF\n",
- link.remote_port,
- to_of_node(link.remote_node));
- v4l2_fwnode_put_link(&link);
- ret = -EINVAL;
- break;
+
+ sink_ep = fwnode_graph_get_remote_endpoint(ep);
+ if (!sink_ep) {
+ dev_dbg(vi->dev, "no sink ep found for %pfw\n",
+ ep);
+ continue;
+ }
+
+ sink_idx = media_entity_get_fwnode_pad(remote, sink_ep,
+ MEDIA_PAD_FL_SINK);
+ if (sink_idx < 0) {
+ dev_dbg(vi->dev, "no sink pad found for %pfw\n",
+ sink_ep);
+ continue;
}
- remote_pad = &remote->pads[link.remote_port];
+ remote_pad = &remote->pads[sink_idx];
create_link:
dev_dbg(vi->dev, "creating %s:%u -> %s:%u link\n",
@@ -1551,8 +1544,8 @@ static int tegra_vi_graph_build(struct tegra_vi_channel *chan,
ret = media_create_pad_link(local, local_pad->index,
remote, remote_pad->index,
link_flags);
- v4l2_fwnode_put_link(&link);
if (ret < 0) {
+ fwnode_handle_put(ep);
dev_err(vi->dev,
"failed to create %s:%u -> %s:%u link: %d\n",
local->name, local_pad->index,
@@ -1561,7 +1554,6 @@ static int tegra_vi_graph_build(struct tegra_vi_channel *chan,
}
}
- fwnode_handle_put(ep);
return ret;
}
--
2.51.0
^ permalink raw reply related
* [PATCH v2 0/1] staging: media: tegra-video: vi: improve VI graph building logic
From: Svyatoslav Ryhel @ 2026-05-23 6:47 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Sowjanya Komatineni,
Luca Ceresoli, Mauro Carvalho Chehab, Hans Verkuil,
Greg Kroah-Hartman, Svyatoslav Ryhel
Cc: linux-media, linux-tegra, linux-staging, linux-kernel
The existing tegra_vi_graph_build function relies heavily on a one-to-one
match between Device Tree nodes and media pad links. While this works for
simpler configurations, it causes issues when Device Tree nodes do not
match media pad link logic (e.g., mt9m114). Switch to the
media_entity_get_fwnode_pad helper to verify and retrieve the correct pad
linked to an endpoint, rather than assuming the endpoint ID matches the
pad ID.
---
Changes in v2:
- fixed use of NULL fw pointers in debug prints
---
Svyatoslav Ryhel (1):
staging: media: tegra-video: vi: Improve media graph building logic
drivers/staging/media/tegra-video/vi.c | 78 ++++++++++++--------------
1 file changed, 35 insertions(+), 43 deletions(-)
--
2.51.0
^ permalink raw reply
* [PATCH 5/5] staging: sm750fb: deduplicate fbinfo loop in suspend/resume
From: Ahmet Sezgin Duran @ 2026-05-23 5:15 UTC (permalink / raw)
To: gregkh; +Cc: linux-fbdev, linux-staging, linux-kernel, Ahmet Sezgin Duran
In-Reply-To: <20260523051509.166152-1-ahmet@sezginduran.net>
lynxfb_suspend() and lynxfb_resume() both walk sm750_dev->fbinfo[]
via duplicated per-index blocks for fbinfo[0] and fbinfo[1].
Replace each pair of blocks with a for-loop bounded by
sm750_dev->fb_count, the number of successfully registered
framebuffers.
No functional changes intended.
Signed-off-by: Ahmet Sezgin Duran <ahmet@sezginduran.net>
---
drivers/staging/sm750fb/sm750.c | 34 +++++++++++++--------------------
1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 465615b528fd..279471d6cd14 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -388,18 +388,18 @@ static int __maybe_unused lynxfb_suspend(struct device *dev)
{
struct fb_info *info;
struct sm750_dev *sm750_dev;
+ int i;
sm750_dev = dev_get_drvdata(dev);
console_lock();
- info = sm750_dev->fbinfo[0];
- if (info)
- /* 1 means do suspend */
- fb_set_suspend(info, 1);
- info = sm750_dev->fbinfo[1];
- if (info)
- /* 1 means do suspend */
- fb_set_suspend(info, 1);
+
+ for (i = 0; i < sm750_dev->fb_count; i++) {
+ info = sm750_dev->fbinfo[i];
+ if (info)
+ /* 1 means do suspend */
+ fb_set_suspend(info, 1);
+ }
console_unlock();
return 0;
@@ -414,6 +414,7 @@ static int __maybe_unused lynxfb_resume(struct device *dev)
struct lynxfb_par *par;
struct lynxfb_crtc *crtc;
struct lynx_cursor *cursor;
+ int i;
sm750_dev = pci_get_drvdata(pdev);
@@ -421,21 +422,12 @@ static int __maybe_unused lynxfb_resume(struct device *dev)
hw_sm750_inithw(sm750_dev, pdev);
- info = sm750_dev->fbinfo[0];
-
- if (info) {
- par = info->par;
- crtc = &par->crtc;
- cursor = &crtc->cursor;
- memset_io(cursor->vstart, 0x0, cursor->size);
- memset_io(crtc->v_screen, 0x0, crtc->vidmem_size);
- lynxfb_ops_set_par(info);
- fb_set_suspend(info, 0);
- }
+ for (i = 0; i < sm750_dev->fb_count; i++) {
+ info = sm750_dev->fbinfo[i];
- info = sm750_dev->fbinfo[1];
+ if (!info)
+ continue;
- if (info) {
par = info->par;
crtc = &par->crtc;
cursor = &crtc->cursor;
--
2.53.0
^ permalink raw reply related
* [PATCH 1/5] staging: sm750fb: remove commented-out forward declarations
From: Ahmet Sezgin Duran @ 2026-05-23 5:15 UTC (permalink / raw)
To: gregkh; +Cc: linux-fbdev, linux-staging, linux-kernel, Ahmet Sezgin Duran
In-Reply-To: <20260523051509.166152-1-ahmet@sezginduran.net>
The block at the top of sm750.c declares lynxfb_ops_write() and
lynxfb_ops_read() inside a commented-out #ifdef __BIG_ENDIAN guard.
Neither function is defined anywhere in the driver, so the block
is dead. Remove it.
Signed-off-by: Ahmet Sezgin Duran <ahmet@sezginduran.net>
---
drivers/staging/sm750fb/sm750.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c..02db1418476b 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -8,15 +8,6 @@
#include "sm750_accel.h"
#include "sm750_cursor.h"
-/*
- * #ifdef __BIG_ENDIAN
- * ssize_t lynxfb_ops_write(struct fb_info *info, const char __user *buf,
- * size_t count, loff_t *ppos);
- * ssize_t lynxfb_ops_read(struct fb_info *info, char __user *buf,
- * size_t count, loff_t *ppos);
- * #endif
- */
-
/* common var for all device */
static int g_hwcursor = 1;
static int g_noaccel __ro_after_init;
--
2.53.0
^ permalink raw reply related
* [PATCH 4/5] staging: sm750fb: use ARRAY_SIZE macro in fb_find_mode loop
From: Ahmet Sezgin Duran @ 2026-05-23 5:15 UTC (permalink / raw)
To: gregkh; +Cc: linux-fbdev, linux-staging, linux-kernel, Ahmet Sezgin Duran
In-Reply-To: <20260523051509.166152-1-ahmet@sezginduran.net>
The loop in lynxfb_set_fbinfo() iterates over pdb[] and cdb[] using
a hardcoded bound of 3.
Replace it with ARRAY_SIZE(pdb) so the bound tracks the array.
Signed-off-by: Ahmet Sezgin Duran <ahmet@sezginduran.net>
---
drivers/staging/sm750fb/sm750.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index fff9c35ee7b0..465615b528fd 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -764,7 +764,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
g_fbmode[index] = g_fbmode[0];
}
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < ARRAY_SIZE(pdb); i++) {
ret = fb_find_mode(var, info, g_fbmode[index],
pdb[i], cdb[i], NULL, 8);
--
2.53.0
^ permalink raw reply related
* [PATCH 3/5] staging: sm750fb: remove unused struct fields
From: Ahmet Sezgin Duran @ 2026-05-23 5:15 UTC (permalink / raw)
To: gregkh; +Cc: linux-fbdev, linux-staging, linux-kernel, Ahmet Sezgin Duran
In-Reply-To: <20260523051509.166152-1-ahmet@sezginduran.net>
Remove `void *priv` pointer field in following struct definitions:
- `struct lynxfb_crtc`
- `struct lynxfb_output`
Verified that no other code references them.
No functional changes.
Signed-off-by: Ahmet Sezgin Duran <ahmet@sezginduran.net>
---
drivers/staging/sm750fb/sm750.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index d2c522e67f26..56d7e1fa4557 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -145,8 +145,6 @@ struct lynxfb_crtc {
u16 ypanstep;
u16 ywrapstep;
- void *priv;
-
/* cursor information */
struct lynx_cursor cursor;
};
@@ -168,7 +166,6 @@ struct lynxfb_output {
* *channel=1 means secondary channel
* output->channel ==> &crtc->channel
*/
- void *priv;
};
struct lynxfb_par {
--
2.53.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox