From: Alex Dewar <alex.dewar90@gmail.com>
To: Saeed Mahameed <saeedm@nvidia.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvalo@codeaurora.org" <kvalo@codeaurora.org>,
"davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"kuba@kernel.org" <kuba@kernel.org>
Subject: Re: [PATCH] ath10k: sdio: remove reduntant check in for loop
Date: Wed, 16 Sep 2020 17:59:11 +0100 [thread overview]
Message-ID: <57efff54-7aa4-8220-c705-1fdf35b0099e@gmail.com> (raw)
In-Reply-To: <c2987351e3bdad16510dd35847991c2412a9db6b.camel@nvidia.com>
[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;
prev parent reply other threads:[~2020-09-16 20:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 19:19 [PATCH] ath10k: sdio: remove reduntant check in for loop Alex Dewar
2020-09-14 21:51 ` Saeed Mahameed
2020-09-16 16:57 ` [PATCH v2] ath10k: sdio: remove redundant " Alex Dewar
2020-09-17 0:45 ` Julian Calaby
2020-09-24 16:27 ` Kalle Valo
2020-09-27 10:58 ` Alex Dewar
2020-09-29 7:42 ` Kalle Valo
2020-11-06 6:36 ` Kalle Valo
2020-09-16 16:59 ` Alex Dewar [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=57efff54-7aa4-8220-c705-1fdf35b0099e@gmail.com \
--to=alex.dewar90@gmail.com \
--cc=ath10k@lists.infradead.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.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;
as well as URLs for NNTP newsgroup(s).