lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Sep 2020 17:59:11 +0100
From:   Alex Dewar <alex.dewar90@...il.com>
To:     Saeed Mahameed <saeedm@...dia.com>
Cc:     "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "ath10k@...ts.infradead.org" <ath10k@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvalo@...eaurora.org" <kvalo@...eaurora.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "kuba@...nel.org" <kuba@...nel.org>
Subject: Re: [PATCH] ath10k: sdio: remove reduntant check in for loop

[snip]
> 'i' is only referenced once inside the loop to check boundary,
>
> the loop is actually iterating over cur_section, so i would make it
> clear in the loop statement, e.g.:
> Remove the break condition and the cur_section assignment at the end of
> the loop and use the loop statement to do it for you
>
> for (; cur_section; cur_section = next_section)
>
>
>>   		section_size = cur_section->end - cur_section->start;
>>   
>>   		if (section_size <= 0) {
>> @@ -2318,7 +2318,7 @@ static int
>> ath10k_sdio_dump_memory_section(struct ath10k *ar,
>>   			break;
>>   		}
>>   
>> -		if ((i + 1) == mem_region->section_table.size) {
> And for i you can just increment it inline:
> if (++i == ...)

Good suggestions! I've sent a v2 with these changes.

>      
>
>> +		if (i == mem_region->section_table.size) {
>>   			/* last section */
>>   			next_section = NULL;
>>   			skip_size = 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ