From: Ping-Ke Shih <pkshih@realtek.com>
To: Kalle Valo <kvalo@kernel.org>, lilinmao <lilinmao@kylinos.cn>
Cc: "linux-wireless@vger.kern…" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtw89: 8852b: fix cppcheck issues
Date: Tue, 9 Jan 2024 04:48:10 +0000 [thread overview]
Message-ID: <18e771f73c91428e8446f18319f316f5@realtek.com> (raw)
In-Reply-To: <87jzojetms.fsf@kernel.org>
> -----Original Message-----
> From: Kalle Valo <kvalo@kernel.org>
> Sent: Monday, January 8, 2024 11:24 PM
> To: lilinmao <lilinmao@kylinos.cn>
> Cc: Ping-Ke Shih <pkshih@realtek.com>; linux-wireless@vger.kern… <linux-wireless@vger.kernel.org>
> Subject: Re: [PATCH] wifi: rtw89: 8852b: fix cppcheck issues
>
> lilinmao <lilinmao@kylinos.cn> writes:
>
> > I'm very sorry for the various issues encountered during my first patch submission.
> >
> > My patch didn't change the original logic of the code.Perhaps I just changed the way
> > of writing the code to avoid the cppcheck issue.
Yes. I think you didn't change the logic, so explain this and what you made
in commit message as Johannes mentioned.
> >
> >>The original logic looks like
> >>
> >>bool found = false;
> >>
> >>for (idx = 0; idx < RTW89_IQK_CHS_NR; idx++)
> >>if (expr) {
> >>found = true;
> >>break;
> >>}
> >>
> >>if (!found) {
> >>... [A]
> >>}
> >
> > After the 'for' loop ends, 'if (idx > RTW89_IQK_CHS_NR - 1)' is
> > equivalent to 'if (!found).
I prefer 'if (idx >= RTW89_IQK_CHS_NR)'
> > Cppcheck might not have detected the
> > changes to 'idx' within branch [A] which leads it to believe later
> > that 'idx' could be greater than or equal to 'RTW89_IQK_CHS_NR'.
So, can you refine cppcheck?
>
> Our lists drop all html mail, so please use text/plain format and don't
> top post. More info in the wiki link below.
>
Thank you, Kalle. With your reformatting, I can simply reply this. :-)
prev parent reply other threads:[~2024-01-09 4:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-05 10:45 [PATCH] wifi: rtw89: 8852b: fix cppcheck issues lilinmao
2024-01-05 10:50 ` Johannes Berg
2024-01-08 1:49 ` Ping-Ke Shih
[not found] ` <1704693852309064.667.seg@mailgw>
[not found] ` <077A3848-0696-4DCC-99C3-DB5389EA2EA2@kylinos.cn>
2024-01-08 15:23 ` Kalle Valo
2024-01-09 4:48 ` Ping-Ke Shih [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=18e771f73c91428e8446f18319f316f5@realtek.com \
--to=pkshih@realtek.com \
--cc=kvalo@kernel.org \
--cc=lilinmao@kylinos.cn \
--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