Linux wireless drivers development
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: cjz <guagua210311@qq.com>
Cc: linux-staging@vger.kernel.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] rtl8723bs: v3 - Remove global continual_io_error, use local count
Date: Sun, 21 Dec 2025 17:07:36 +0100	[thread overview]
Message-ID: <2025122109-dreamy-obtuse-0bee@gregkh> (raw)
In-Reply-To: <tencent_453BB45207600CD663A5957789EB5CEC1608@qq.com>

On Fri, Dec 19, 2025 at 05:39:47PM +0800, cjz wrote:
> From: changjunzheng <guagua210311@qq.com>
> 
> 1. Remove global 'continual_io_error' variable from struct dvobj_priv (eliminate cross-function dependency)
> 2. Replace global count logic with local 'error_count' in sd_read32/sd_write32
> 3. Delete redundant rtw_inc_and_chk/rtw_reset_continual_io_error functions
> 4. Add independent bool rtw_check_continual_io_error() (single responsibility)
> 5. Comply with kernel coding style (whitespace, indentation, variable declaration)

When you list different things, that's a huge hint that you need to have
multiple patches as a series.

> Signed-off-by: changjunzheng <guagua210311@qq.com>

Is this how you sign documents?  Sorry, I have to ask.

> ---

What changed from previous versions should be below here, as the
documentation requests to have happen.



>  drivers/staging/rtl8723bs/core/rtw_io.c         | 17 ++---------------
>  drivers/staging/rtl8723bs/include/drv_types.h   |  1 -
>  drivers/staging/rtl8723bs/include/rtw_io.h      |  3 +--
>  .../staging/rtl8723bs/os_dep/sdio_ops_linux.c   | 16 +++++++++-------
>  4 files changed, 12 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
> index 0f52710e6d3a..33023ae45196 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_io.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_io.c
> @@ -131,20 +131,7 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
>  
>  	return _SUCCESS;
>  }
> -
> -/*
> - * Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
> - * @return true:
> - * @return false:
> - */
> -int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
> -{
> -	dvobj->continual_io_error++;
> -	return (dvobj->continual_io_error > MAX_CONTINUAL_IO_ERR);
> -}
> -
> -/* Set the continual_io_error of this @param dvobjprive to 0 */
> -void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
> +bool rtw_check_continual_io_error(int error_count)
>  {
> -	dvobj->continual_io_error = 0;
> +    return (error_count > MAX_CONTINUAL_IO_ERR) ? true : false;
>  }
> diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
> index bd7bb5828d56..de4bec961671 100644
> --- a/drivers/staging/rtl8723bs/include/drv_types.h
> +++ b/drivers/staging/rtl8723bs/include/drv_types.h
> @@ -279,7 +279,6 @@ struct dvobj_priv {
>  	u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
>  
>  	u8 irq_alloc;
> -	int continual_io_error;
>  
>  	atomic_t disable_func;
>  
> diff --git a/drivers/staging/rtl8723bs/include/rtw_io.h b/drivers/staging/rtl8723bs/include/rtw_io.h
> index adf1de4d7924..8ae8849f5fd9 100644
> --- a/drivers/staging/rtl8723bs/include/rtw_io.h
> +++ b/drivers/staging/rtl8723bs/include/rtw_io.h
> @@ -48,8 +48,6 @@ struct	intf_hdl {
>  #define SD_IO_TRY_CNT (8)
>  #define MAX_CONTINUAL_IO_ERR SD_IO_TRY_CNT
>  
> -int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj);
> -void rtw_reset_continual_io_error(struct dvobj_priv *dvobj);
>  
>  struct io_priv {
>  
> @@ -70,5 +68,6 @@ extern int rtw_write32(struct adapter *adapter, u32 addr, u32 val);
>  extern u32 rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
>  
>  int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapter *padapter, struct _io_ops *pops));
> +bool rtw_check_continual_io_error(int error_count);
>  
>  #endif	/* _RTL8711_IO_H_ */
> diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> index 5dc00e9117ae..571a2c6fc37a 100644
> --- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> @@ -207,7 +207,7 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
>  
>  	if (err && *err) {
>  		int i;
> -
> +		int error_count = 0;
>  		*err = 0;
>  		for (i = 0; i < SD_IO_TRY_CNT; i++) {
>  			if (claim_needed)
> @@ -217,13 +217,13 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
>  				sdio_release_host(func);
>  
>  			if (*err == 0) {
> -				rtw_reset_continual_io_error(psdiodev);
> +				error_count=0;
>  				break;
>  			} else {
>  				if ((-ESHUTDOWN == *err) || (-ENODEV == *err))
>  					padapter->bSurpriseRemoved = true;
> -
> -				if (rtw_inc_and_chk_continual_io_error(psdiodev) == true) {
> +				error_count++; 

This adds a coding style error, please always run your patches through
checkpatch before sending them out.

thanks,

greg k-h

      reply	other threads:[~2025-12-21 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19  9:39 [PATCH v3] rtl8723bs: v3 - Remove global continual_io_error, use local count cjz
2025-12-21 16:07 ` Greg KH [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=2025122109-dreamy-obtuse-0bee@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=guagua210311@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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