From: Dan Carpenter <error27@gmail.com>
To: Hungyu Lin <dennylin0707@gmail.com>
Cc: gregkh@linuxfoundation.org, b9788213@gmail.com,
ethantidmore@gmail.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] staging: rtl8723bs: convert xmit init path to standard error codes
Date: Wed, 8 Apr 2026 10:40:28 +0300 [thread overview]
Message-ID: <adYGbBEBDkNGBr95@stanley.mountain> (raw)
In-Reply-To: <20260405232534.14122-1-dennylin0707@gmail.com>
On Sun, Apr 05, 2026 at 11:25:34PM +0000, Hungyu Lin wrote:
> Replace the use of _SUCCESS/_FAIL return values with standard
> kernel return conventions (0 on success, negative errno on failure)
> in the xmit initialization path.
>
> Specifically:
> - rtw_os_xmit_resource_alloc() now returns 0 or -ENOMEM
> - rtw_alloc_hwxmits() now returns 0 or -ENOMEM
> - _rtw_init_xmit_priv() updated to propagate error codes and use
> direct truth checks instead of comparing with _FAIL
> - caller in os_intfs.c updated accordingly
>
> This improves error propagation and aligns the driver with
> kernel coding style.
>
> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
> ---
Break this up into a bunch of patches:
patch 1: Change _rtw_init_xmit_priv() to use direct returns and get
rid of the exit label.
patch 2: Make rtw_alloc_hwxmits() static
patch 3: Make rtw_alloc_hwxmits() return negative error codes and update
the call site to look like this:
res = rtw_alloc_hwxmits();
if (res)
return _FAIL;
patch 4: Move rtw_os_xmit_resource_alloc() to
drivers/staging/rtl8723bs/core/rtw_xmit.c and make it static.
patch 5: Make rtw_os_xmit_resource_alloc() return -ENOMEM on failure
and update the call sites to look like:
res = rtw_os_xmit_resource_alloc();
if (res)
return _FAIL;
patch 6: Change _rtw_init_xmit_priv() to return negative error codes
and update the call sites to look like:
res = _rtw_init_xmit_priv(&padapter->xmitpriv, padapter);
if (res)
goto free_mlme_ext;
Making the functions static makes them easier to review so we don't
have to jump around between files. Doing it one function at a time
is easier to review because we don't have to remember all the
functions which were changed. Direct returns are easier to review
because we don't have to scroll to the bottom of the function.
regards,
dan carpenter
prev parent reply other threads:[~2026-04-08 7:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-05 23:25 [PATCH v3] staging: rtl8723bs: convert xmit init path to standard error codes Hungyu Lin
2026-04-08 7:40 ` Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adYGbBEBDkNGBr95@stanley.mountain \
--to=error27@gmail.com \
--cc=b9788213@gmail.com \
--cc=dennylin0707@gmail.com \
--cc=ethantidmore@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox