From: Eric Engestrom <eric.engestrom@intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: linux-pm@vger.kernel.org, Viresh Kumar <viresh.kumar@linaro.org>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
LKML <linux-kernel@vger.kernel.org>,
DRI Development <dri-devel@lists.freedesktop.org>,
Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 04/12] cpufreq: use for_each_if
Date: Mon, 9 Jul 2018 10:28:27 +0100 [thread overview]
Message-ID: <20180709092827.GA2841@intel.com> (raw)
In-Reply-To: <20180709083650.23549-4-daniel.vetter@ffwll.ch>
On Monday, 2018-07-09 10:36:42 +0200, Daniel Vetter wrote:
> Avoids the inverted condition compared to the open coded version.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> ---
> include/linux/cpufreq.h | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 882a9b9e34bc..f2028c229b96 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -649,9 +649,7 @@ static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
>
> #define cpufreq_for_each_valid_entry(pos, table) \
> for (pos = table; pos->frequency != CPUFREQ_TABLE_END; pos++) \
> - if (pos->frequency == CPUFREQ_ENTRY_INVALID) \
> - continue; \
> - else
> + for_each_if (pos->frequency != CPUFREQ_ENTRY_INVALID)
>
> /*
> * cpufreq_for_each_valid_entry_idx - iterate with index over a cpufreq
> @@ -663,9 +661,7 @@ static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
>
> #define cpufreq_for_each_valid_entry_idx(pos, table, idx) \
> cpufreq_for_each_entry_idx(pos, table, idx) \
> - if (pos->frequency == CPUFREQ_ENTRY_INVALID) \
> - continue; \
> - else
> + for_each_if (pos->frequency == CPUFREQ_ENTRY_INVALID)
Should be `!=` there ^
>
>
> int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
> --
> 2.18.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-07-09 9:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180709083650.23549-1-daniel.vetter@ffwll.ch>
2018-07-09 8:36 ` [PATCH 04/12] cpufreq: use for_each_if Daniel Vetter
2018-07-09 9:28 ` Eric Engestrom [this message]
2018-07-09 16:11 ` [PATCH] " Daniel Vetter
2018-07-09 21:36 ` Rafael J. Wysocki
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=20180709092827.GA2841@intel.com \
--to=eric.engestrom@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.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;
as well as URLs for NNTP newsgroup(s).