Search Linux Wireless

Re: [PATCH] wifi: rtw89: 8852b: fix cppcheck issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



lilinmao <lilinmao@xxxxxxxxxx> 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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux