Linux kernel staging patches
 help / color / mirror / Atom feed
From: Nikolay Kulikov <nikolayof23@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev
Subject: Re: [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings
Date: Mon, 11 May 2026 16:59:48 +0300	[thread overview]
Message-ID: <agHg1J88_vHg2FWC@archlinux> (raw)
In-Reply-To: <agGfAqihe8DHqTPp@stanley.mountain>

On Mon, May 11, 2026 at 12:18:58PM +0300, Dan Carpenter wrote:
> On Mon, May 11, 2026 at 10:55:30AM +0300, Nikolay Kulikov wrote:
> > The code reads a 32-bit value from REG_HSIMR and writes the result back
> > to the same address. This operation does not change the register's
> > value.
> > 
> > This code does nothing and simply performs unnecessary SDIO operations.
> > Furthermore, if rtw_read32() returns an error or returns an
> > uninitialized value, writing it back will have unknown consequences.
> > 
> 
> This commit message isn't very useful.
> 
> There can be times where reading from a register and then writing the
> exact same thing back to it is how the hardware is designed.  So it's
> not obvious at all that making this change is safe.
> 
> What you should say is that:
> 
> Originally, this code use to Step 1: read from the register,
> Step 2: add some bits to the value and then Step 3: write the result
> back to the register.
> 
> However the problem was that the bits in step 2 were always zero so
> I have removed that code.  Now this function just reads a value and
> writes the exact same thing back.  It is unnecessary and can be
> removed.
> 
> It's not 100% safe to make this change without testing, but it
> probably is safe enough once we see the explanation *why* the code
> *used* to exist.

Indeed, it's much clearer this way, I'll fix it in v2.


Thanks,
Nikolay

  reply	other threads:[~2026-05-11 13:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11  7:55 [PATCH 0/4] staging: rtl8723bs: remove unused sys interrupt Nikolay Kulikov
2026-05-11  7:55 ` [PATCH 1/4] staging: rtl8723bs: remove unused SysIntrMask from struct hal_com_data Nikolay Kulikov
2026-05-11  7:55 ` [PATCH 2/4] staging: rtl8723bs: remove empty InitSysInterrupt8723BSdio() Nikolay Kulikov
2026-05-11  7:55 ` [PATCH 3/4] staging: rtl8723bs: remove overwriting of current IMR settings Nikolay Kulikov
2026-05-11  9:18   ` Dan Carpenter
2026-05-11 13:59     ` Nikolay Kulikov [this message]
2026-05-11  7:55 ` [PATCH 4/4] staging: rtl8723bs: remove unused SysIntrStatus from struct hal_com_data Nikolay Kulikov

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=agHg1J88_vHg2FWC@archlinux \
    --to=nikolayof23@gmail.com \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.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