Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1672819
| From | Juri Lelli <juri.lelli@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V2 4/5] arch_topology: Return 0 or -ve errors from topology_parse_cpu_capacity() |
| Date | 2017-06-22 18:50 +0200 |
| Message-ID | <tVdsT-7hT-35@gated-at.bofh.it> (permalink) |
| References | <tUFKy-1oG-5@gated-at.bofh.it> <tUFKy-1oG-11@gated-at.bofh.it> <tV6Up-2Rl-13@gated-at.bofh.it> <tVbho-5Uv-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 22/06/17 19:58, Viresh Kumar wrote:
> On 22-06-17, 10:39, Juri Lelli wrote:
> > Hi,
> >
> > On 21/06/17 10:16, Viresh Kumar wrote:
> > > Use the standard way of returning errors instead of returning 0(failure)
> > > OR 1(success) and making it hard to read.
> > >
> > > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > > ---
> > > arch/arm/kernel/topology.c | 2 +-
> > > drivers/base/arch_topology.c | 8 ++++----
> > > 2 files changed, 5 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> > > index bf949a763dbe..a7ef4c35855e 100644
> > > --- a/arch/arm/kernel/topology.c
> > > +++ b/arch/arm/kernel/topology.c
> > > @@ -111,7 +111,7 @@ static void __init parse_dt_topology(void)
> > > continue;
> > > }
> > >
> > > - if (topology_parse_cpu_capacity(cn, cpu)) {
> > > + if (!topology_parse_cpu_capacity(cn, cpu)) {
> >
> > Not sure why you want to change this.
>
> I just didn't find it straight forward to read.
>
> > I currently read it as "if cpu_capacity parsing succedeed" continue with
> > next CPU, otherwise we set cap_from_dt to false and fall back to using
> > efficiencies.
>
> Actually, I can just make the return type bool and that should solve
> the issues I was seeing and keep the code as it is.
>
> Will that be fine ?
>
Think so.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V2 0/5] arch_topology: Minor cleanups Viresh Kumar <viresh.kumar@linaro.org> - 2017-06-21 06:50 +0200
[PATCH V2 3/5] arch_topology: Covert switch block to if block Viresh Kumar <viresh.kumar@linaro.org> - 2017-06-21 06:50 +0200
[PATCH V2 4/5] arch_topology: Return 0 or -ve errors from topology_parse_cpu_capacity() Viresh Kumar <viresh.kumar@linaro.org> - 2017-06-21 06:50 +0200
Re: [PATCH V2 4/5] arch_topology: Return 0 or -ve errors from topology_parse_cpu_capacity() Juri Lelli <juri.lelli@arm.com> - 2017-06-22 11:50 +0200
Re: [PATCH V2 4/5] arch_topology: Return 0 or -ve errors from topology_parse_cpu_capacity() Viresh Kumar <viresh.kumar@linaro.org> - 2017-06-22 16:30 +0200
Re: [PATCH V2 4/5] arch_topology: Return 0 or -ve errors from topology_parse_cpu_capacity() Juri Lelli <juri.lelli@arm.com> - 2017-06-22 18:50 +0200
[PATCH V2 5/5] arch_topology: Localize cap_parsing_failed to topology_parse_cpu_capacity() Viresh Kumar <viresh.kumar@linaro.org> - 2017-06-21 06:50 +0200
[PATCH V2 2/5] arch_topology: Don't break lines unnecessarily Viresh Kumar <viresh.kumar@linaro.org> - 2017-06-21 06:50 +0200
[PATCH V2 1/5] arch_topology: Get rid of "cap_parsing_done" Viresh Kumar <viresh.kumar@linaro.org> - 2017-06-21 06:50 +0200
Re: [PATCH V2 1/5] arch_topology: Get rid of "cap_parsing_done" Juri Lelli <juri.lelli@arm.com> - 2017-06-22 11:50 +0200
Re: [PATCH V2 1/5] arch_topology: Get rid of "cap_parsing_done" Viresh Kumar <viresh.kumar@linaro.org> - 2017-06-22 16:30 +0200
Re: [PATCH V2 1/5] arch_topology: Get rid of "cap_parsing_done" Juri Lelli <juri.lelli@arm.com> - 2017-06-22 18:50 +0200
csiph-web