Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1424024
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared |
| Date | 2016-06-16 14:50 +0200 |
| Message-ID | <rKEUa-8qv-17@gated-at.bofh.it> (permalink) |
| References | <rKz86-4OM-11@gated-at.bofh.it> <rKEAN-8ja-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 16-06-16, 14:25, Rafael J. Wysocki wrote: > On Thu, Jun 16, 2016 at 8:33 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote: > > + if (opp_table->shared_opp == OPP_TABLE_IS_SHARED) > > + return opp_table; > > + > > + return NULL; > > That still can be > > return opp_table->shared_opp == OPP_TABLE_IS_SHARED ? opp_table : NULL; > > > } > > } > > > > + if (of_property_read_bool(opp_np, "opp-shared")) > > + opp_table->shared_opp = OPP_TABLE_IS_SHARED; > > + else > > + opp_table->shared_opp = OPP_TABLE_IS_NOT_SHARED; > > And here > > opp_table->shared_opp = of_property_read_bool(opp_np, "opp-shared") ? > OPP_TABLE_IS_SHARED : > OPP_TABLE_IS_NOT_SHARED; Conditional statement for both these cases is getting very long and if/else looks much more readable. And so I would like to stick with that, if you allow. > > +#define OPP_TABLE_IS_NOT_SHARED 0 > > +#define OPP_TABLE_IS_SHARED 1 > > +#define OPP_TABLE_SHARED_UNKNOWN UINT_MAX > > Please change this into an enum type. > Besides, I'd call them OPP_TABLE_ACCESS_SHARED, > OPP_TABLE_ACCESS_EXCLUSIVE, OPP_TABLE_ACCESS_UNKNOWN or similar, but I > don't care that much either. Sure. This can be done. -- viresh
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared Viresh Kumar <viresh.kumar@linaro.org> - 2016-06-16 08:40 +0200
Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared Alexandre Courbot <acourbot@nvidia.com> - 2016-06-16 09:00 +0200
Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared Viresh Kumar <viresh.kumar@linaro.org> - 2016-06-16 09:00 +0200
Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared "Rafael J. Wysocki" <rafael@kernel.org> - 2016-06-16 14:30 +0200
Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared Viresh Kumar <viresh.kumar@linaro.org> - 2016-06-16 14:50 +0200
Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared "Rafael J. Wysocki" <rafael@kernel.org> - 2016-06-16 15:30 +0200
csiph-web