Linux kernel staging patches
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: 2023060904@ycu.edu.cn
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	guagua210311@qq.com
Subject: Re: [PATCH] [rtl8723bs] Remove unnecessary atomic operations for continual_io_error
Date: Mon, 19 Jan 2026 09:20:49 +0100	[thread overview]
Message-ID: <2026011937-snugness-movie-9e32@gregkh> (raw)
In-Reply-To: <30BAC49CD5860042+20260119080606.189297-1-2023060904@ycu.edu.cn>

On Mon, Jan 19, 2026 at 04:06:06PM +0800, 2023060904@ycu.edu.cn wrote:
> From: Changjun Zheng <guagua210311@qq.com>
> 
> continual_io_error is only accessed in SDIO IO single execution flow,
> no multi-thread race condition exists, so atomic operations are redundant.
> Change atomic_t to s32 and replace atomic_inc_return/atomic_set with normal ops.
> 
> Signed-off-by: Changjun Zheng <guagua210311@qq.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_io.c       | 16 ++++++++++++----
>  drivers/staging/rtl8723bs/include/drv_types.h |  2 +-
>  2 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
> index fe9f94001eed..95d42025807e 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_io.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_io.c
> @@ -135,11 +135,15 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
>  /*
>   * Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
>   * @return true:
> - * @return false:
> + * @return false:
> +
> + * Note: Original implementation used atomic_inc_return for atomic increment.
> + * Reason for change: continual_io_error is only accessed in SDIO IO single execution flow,
> + * no race condition, so normal increment is safe (remove redundant atomic operation).

This is not needed, the git history should show this.

>   */
>  int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
>  {
> -	int error_count = atomic_inc_return(&dvobj->continual_io_error);
> +	s32 error_count = ++dvobj->continual_io_error;

No, please just put this in the caller, like was discussed already on
the list.  Please read the archives for details.

thanks,

greg k-h

  reply	other threads:[~2026-01-19  8:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19  8:06 [PATCH] [rtl8723bs] Remove unnecessary atomic operations for continual_io_error 2023060904
2026-01-19  8:20 ` Greg KH [this message]
2026-01-20 14:11   ` [PATCH v2 1/2] rtl8723bs: Refactor continual_io_error check 2023060904
2026-01-20 14:34     ` Greg KH
2026-01-21 13:22     ` Dan Carpenter
2026-01-21 13:27       ` Greg KH
     [not found]   ` <20260120141129.8262-1-2023060904@ycu.edu.cn>
2026-01-20 14:11     ` [PATCH v2 2/2] rtl8723bs: Replace atomic ops with normal vars 2023060904
2026-01-19  8:25 ` [PATCH] [rtl8723bs] Remove unnecessary atomic operations for continual_io_error Dan Carpenter
2026-01-20 13:39   ` 2023060904
2026-01-20 14:05     ` Greg KH
2026-01-20 14:18     ` Dan Carpenter

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=2026011937-snugness-movie-9e32@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=2023060904@ycu.edu.cn \
    --cc=guagua210311@qq.com \
    --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