From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Prithvi <activprithvi@gmail.com>
Cc: gregkh@linuxfoundation.org, abrahamadekunle50@gmail.com,
straube.linux@gmail.com, b9788213@gmail.com,
ethantidmore06@gmail.com, dan.carpenter@linaro.org,
weibu@redadmin.org, knavaneeth786@gmail.com,
ignacio.pena87@gmail.com, dharanitharan725@gmail.com,
lukagejak5@gmail.com, samasth.norway.ananda@oracle.com,
karanja99erick@gmail.com, s9430939@naver.com,
suunj1331@gmail.com, ysinghcin@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linux.dev, skhan@linuxfoundation.org,
david.hunter.linux@gmail.com, khalid@kernel.org
Subject: Re: [PATCH v2] staging: rtl8723bs: fix constant on left side of test checkpatch warnings
Date: Tue, 24 Mar 2026 15:43:08 +0200 [thread overview]
Message-ID: <acKU7JjW3OFugHXY@ashevche-desk.local> (raw)
In-Reply-To: <20260324130234.3776tp4ykuerffcg@inspiron>
On Tue, Mar 24, 2026 at 06:32:34PM +0530, Prithvi wrote:
> On Mon, Mar 23, 2026 at 06:42:49PM +0200, Andy Shevchenko wrote:
> > On Mon, Mar 23, 2026 at 09:59:01PM +0530, Prithvi Tambewagh wrote:
...
> > > do {
> > > valid = rtw_read8(padapter, REG_HMETFR) & BIT(msgbox_num);
> > > - if (0 == valid) {
> > > + if (!valid)
> > > read_down = true;
> > > - }
> > > } while ((!read_down) && (retry_cnts--));
> > >
> > > return read_down;
> >
> > This entire piece can be replaced with something from iopoll.h.
>
> Yes...I checked out and found we can use read_poll_timeout_atomic():
...
> #include <rtl8723b_hal.h>
> #include <linux/etherdevice.h>
> #include "hal_com_h2c.h"
> +#include <linux/iopoll.h>
Just make sure you put it in a better (more ordered) place, like one line above.
...
#include <linux/etherdevice.h>
#include <linux/iopoll.h>
...
...
> static u8 _is_fw_read_cmd_down(struct adapter *padapter, u8 msgbox_num)
> {
> u8 valid;
> + int ret;
> +
> + ret = read_poll_timeout_atomic(rtw_read8,
> + valid,
> + !(valid & BIT(msgbox_num)),
> + 0,
> + 500,
> + false,
> + padapter, REG_HMETFR);
> + return !ret;
ret = read_poll_timeout_atomic(rtw_read8,
valid, !(valid & BIT(msgbox_num)),
0, 500, false,
padapter, REG_HMETFR);
return !ret;
> }
>
> Is this approach correct?
Yes, looks correct. Just compress it a bit and fix indentation,
see above how.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-03-24 13:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 16:29 [PATCH v2] staging: rtl8723bs: fix constant on left side of test checkpatch warnings Prithvi Tambewagh
2026-03-23 16:42 ` Andy Shevchenko
2026-03-24 13:02 ` Prithvi
2026-03-24 13:43 ` Andy Shevchenko [this message]
2026-03-24 13:55 ` Prithvi
2026-03-24 14:05 ` Andy Shevchenko
2026-03-24 16:02 ` Prithvi
2026-03-24 17:41 ` Shuah Khan
2026-03-25 7:22 ` Dan Carpenter
2026-03-25 17:57 ` Shuah Khan
2026-03-25 21:34 ` Dan Carpenter
2026-03-25 22:22 ` Shuah Khan
2026-03-28 17:47 ` Prithvi
2026-03-30 16:03 ` Greg KH
2026-04-03 7:31 ` Prithvi
2026-04-03 8:04 ` Greg KH
2026-04-03 9:46 ` Prithvi
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=acKU7JjW3OFugHXY@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=abrahamadekunle50@gmail.com \
--cc=activprithvi@gmail.com \
--cc=b9788213@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=david.hunter.linux@gmail.com \
--cc=dharanitharan725@gmail.com \
--cc=ethantidmore06@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=ignacio.pena87@gmail.com \
--cc=karanja99erick@gmail.com \
--cc=khalid@kernel.org \
--cc=knavaneeth786@gmail.com \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=lukagejak5@gmail.com \
--cc=s9430939@naver.com \
--cc=samasth.norway.ananda@oracle.com \
--cc=skhan@linuxfoundation.org \
--cc=straube.linux@gmail.com \
--cc=suunj1331@gmail.com \
--cc=weibu@redadmin.org \
--cc=ysinghcin@gmail.com \
/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