Re: [PATCH v2 3/4] staging: rtl8723bs: convert update_attrib_sec_info to return errno

From: Dan Carpenter

Date: Tue Jun 16 2026 - 03:44:28 EST


On Mon, Jun 15, 2026 at 11:43:39PM +0000, Hungyu Lin wrote:
> Convert update_attrib_sec_info() to return 0 on success and
> a negative errno on failure.
>
> No functional change intended.
>
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 69b6d3a2554a..0fd2415e7bb7 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -505,7 +505,7 @@ static void update_attrib_phy_info(struct adapter *padapter, struct pkt_attrib *
> pattrib->retry_ctrl = false;
> }
>
> -static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta)
> +static int update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta)
> {

Sorry, I was unclear. You tried to follow my directions and then v2
introduced a bug as a result when actually v1 worked... What I want
here is to update the check in the caller but not what it returns.

1 Bad:

if (update_attrib_sec_info() == _FAIL)
return _FAIL;

2 Not yet:
ret = update_attrib_sec_info();
if (ret)
return ret;

3 Good:
ret = update_attrib_sec_info();
if (ret)
return _FAIL;

And then in the next patch change all the return _FAIL sites in the
caller. So we'll eventually move to option 2, but in a two step
process.

regards,
dan carpenter