All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: lilinmao <lilinmao@kylinos.cn>
Cc: "pkshih@realtek.com" <pkshih@realtek.com>,
	"linux-wireless@vger.kern…" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] wifi: rtw89: 8852b: fix cppcheck issues
Date: Mon, 08 Jan 2024 17:23:39 +0200	[thread overview]
Message-ID: <87jzojetms.fsf@kernel.org> (raw)
In-Reply-To: <077A3848-0696-4DCC-99C3-DB5389EA2EA2@kylinos.cn> (lilinmao@kylinos.cn's message of "Mon, 8 Jan 2024 14:47:18 +0800")

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.
>
>>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). 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'.

Our lists drop all html mail, so please use text/plain format and don't
top post. More info in the wiki link below.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  parent reply	other threads:[~2024-01-08 15:23 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 [this message]
2024-01-09  4:48       ` Ping-Ke Shih

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=87jzojetms.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=lilinmao@kylinos.cn \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.