linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	acourbot@nvidia.com, Viresh Kumar <vireshk@kernel.org>,
	Nishanth Menon <nm@ti.com>, Stephen Boyd <sboyd@codeaurora.org>,
	Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared
Date: Thu, 16 Jun 2016 18:18:18 +0530	[thread overview]
Message-ID: <20160616124818.GN5726@vireshk-i7> (raw)
In-Reply-To: <CAJZ5v0gqbU8bc0k8ZHare6Tv4Nno5o4pYQwwzTP6Ha1xS3WDOg@mail.gmail.com>

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

  reply	other threads:[~2016-06-16 12:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16  6:33 [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared Viresh Kumar
2016-06-16  6:55 ` Alexandre Courbot
2016-06-16  6:57   ` Viresh Kumar
2016-06-16 12:25 ` Rafael J. Wysocki
2016-06-16 12:48   ` Viresh Kumar [this message]
2016-06-16 13:26     ` 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=20160616124818.GN5726@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=acourbot@nvidia.com \
    --cc=gnurou@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=vireshk@kernel.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).