Re: [PATCH v2 5/5] cpufreq: vexpress-spc: fix some coding style issues

From: Nicolas Pitre
Date: Fri Oct 18 2019 - 11:51:48 EST


On Fri, 18 Oct 2019, Sudeep Holla wrote:

> On Fri, Oct 18, 2019 at 11:25:17AM +0530, Viresh Kumar wrote:
> > On 17-10-19, 13:35, Sudeep Holla wrote:
> > > Fix the following checkpatch checks/warnings:
> > >
> > > CHECK: Unnecessary parentheses around the code
> > > CHECK: Alignment should match open parenthesis
> > > CHECK: Prefer kernel type 'u32' over 'uint32_t'
> > > WARNING: Missing a blank line after declarations
> > >
> > > Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
> > > ---
> > > drivers/cpufreq/vexpress-spc-cpufreq.c | 43 ++++++++++++--------------
> > > 1 file changed, 20 insertions(+), 23 deletions(-)
> > >
> > > diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c
> > > index 81064430317f..8ecb2961be86 100644
> > > --- a/drivers/cpufreq/vexpress-spc-cpufreq.c
> > > +++ b/drivers/cpufreq/vexpress-spc-cpufreq.c
> > > @@ -79,8 +79,8 @@ static unsigned int find_cluster_maxfreq(int cluster)
> > > for_each_online_cpu(j) {
> > > cpu_freq = per_cpu(cpu_last_req_freq, j);
> > >
> > > - if ((cluster == per_cpu(physical_cluster, j)) &&
> > > - (max_freq < cpu_freq))
> > > + if (cluster == per_cpu(physical_cluster, j) &&
> > > + max_freq < cpu_freq)
> > > max_freq = cpu_freq;
> > > }
> > >
> > > @@ -188,22 +188,19 @@ static int ve_spc_cpufreq_set_target(struct cpufreq_policy *policy,
> > > freqs_new = freq_table[cur_cluster][index].frequency;
> > >
> > > if (is_bL_switching_enabled()) {
> > > - if ((actual_cluster == A15_CLUSTER) &&
> > > - (freqs_new < clk_big_min)) {
> > > + if (actual_cluster == A15_CLUSTER && freqs_new < clk_big_min)
> > > new_cluster = A7_CLUSTER;
> > > - } else if ((actual_cluster == A7_CLUSTER) &&
> > > - (freqs_new > clk_little_max)) {
> > > + else if (actual_cluster == A7_CLUSTER &&
> > > + freqs_new > clk_little_max)
> > > new_cluster = A15_CLUSTER;
> > > - }
> > > }
> > >
> > > ret = ve_spc_cpufreq_set_rate(cpu, actual_cluster, new_cluster,
> > > freqs_new);
> > >
> > > - if (!ret) {
> > > + if (!ret)
> >
> > That's not the standard way in Linux I believe. We do use {} even when
> > the body is single line but broken into two, like below.
> >
>
> OK, wasn't aware of that. I will update. Generally I ignore checkpatch
> warnings, but the list was big and fixed a bunch of them :)

In cases like this one, the best is to go with whatever makes checkpatch
happy.


Nicolas