All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Mike Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>, Chen-Yu Tsai <wens@csie.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Mylene Josserand <mylene.josserand@free-electrons.com>,
	linux-clk <linux-clk@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: Re: [PATCH v2 2/7] clk: sunxi-ng: div: Allow to set a maximum
Date: Wed, 7 Sep 2016 00:20:10 +0800	[thread overview]
Message-ID: <CAGb2v66C9GJ5Svm+7NE2cStc5KiNgoriB329K4fhZJMTSbZ8Kw@mail.gmail.com> (raw)
In-Reply-To: <20160906121837.7517-3-maxime.ripard@free-electrons.com>

On Tue, Sep 6, 2016 at 8:18 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Some dividers might have a maximum value that is lower than the width of
> the register.
>
> Add a field to _ccu_div to handle those case properly. If the field is set
> to 0, the code will assume that the maximum value is the maximum one that
> can be used with the field register width.

This is a bit confusing. What is the maximum referring to? The raw value
in the register? Or the actual divider?

Personally I'd go with the maximum valid value of the register. You
could get rid of the special power-of-2 handling code you added.

Either way I think the message and the field name should be more explicit.

>
> Otherwise, we'll use whatever value has been set.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

[...]

The code looks correct.


Regards
ChenYu

WARNING: multiple messages have this Message-ID (diff)
From: wens@csie.org (Chen-Yu Tsai)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/7] clk: sunxi-ng: div: Allow to set a maximum
Date: Wed, 7 Sep 2016 00:20:10 +0800	[thread overview]
Message-ID: <CAGb2v66C9GJ5Svm+7NE2cStc5KiNgoriB329K4fhZJMTSbZ8Kw@mail.gmail.com> (raw)
In-Reply-To: <20160906121837.7517-3-maxime.ripard@free-electrons.com>

On Tue, Sep 6, 2016 at 8:18 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Some dividers might have a maximum value that is lower than the width of
> the register.
>
> Add a field to _ccu_div to handle those case properly. If the field is set
> to 0, the code will assume that the maximum value is the maximum one that
> can be used with the field register width.

This is a bit confusing. What is the maximum referring to? The raw value
in the register? Or the actual divider?

Personally I'd go with the maximum valid value of the register. You
could get rid of the special power-of-2 handling code you added.

Either way I think the message and the field name should be more explicit.

>
> Otherwise, we'll use whatever value has been set.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

[...]

The code looks correct.


Regards
ChenYu

  reply	other threads:[~2016-09-06 16:20 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 12:18 [PATCH v2 0/7] clk: sunxi-ng: Introduce support for A23 and A33 CCUs Maxime Ripard
2016-09-06 12:18 ` Maxime Ripard
2016-09-06 12:18 ` Maxime Ripard
2016-09-06 12:18 ` [PATCH v2 1/7] clk: sunxi-ng: div: Add mux table macros Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-06 12:18 ` [PATCH v2 2/7] clk: sunxi-ng: div: Allow to set a maximum Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-06 16:20   ` Chen-Yu Tsai [this message]
2016-09-06 16:20     ` Chen-Yu Tsai
2016-09-08  8:53     ` Maxime Ripard
2016-09-08  8:53       ` Maxime Ripard
2016-09-06 12:18 ` [PATCH v2 3/7] clk: sunxi-ng: mux: Add mux table macro Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-06 12:18 ` [PATCH v2 4/7] clk: sunxi-ng: Add N-class clocks support Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-07  6:45   ` Chen-Yu Tsai
2016-09-07  6:45     ` Chen-Yu Tsai
2016-09-06 12:18 ` [PATCH v2 5/7] clk: sunxi-ng: Add A33 CCU support Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-07  7:06   ` Chen-Yu Tsai
2016-09-07  7:06     ` Chen-Yu Tsai
2016-09-06 12:18 ` [PATCH v2 6/7] clk: sunxi-ng: Add A23 CCU Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-07  7:24   ` Chen-Yu Tsai
2016-09-07  7:24     ` Chen-Yu Tsai
2016-09-08  8:29     ` Maxime Ripard
2016-09-08  8:29       ` Maxime Ripard
2016-09-08  8:29       ` Maxime Ripard
2016-09-08  8:32       ` Chen-Yu Tsai
2016-09-08  8:32         ` Chen-Yu Tsai
2016-09-08  8:35         ` Chen-Yu Tsai
2016-09-08  8:35           ` Chen-Yu Tsai
2016-09-08  8:35           ` Chen-Yu Tsai
2016-09-08  9:20         ` Maxime Ripard
2016-09-08  9:20           ` Maxime Ripard
2016-09-06 12:18 ` [PATCH v2 7/7] ARM: sun8i: Convert the A23 and A33 to the CCU Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-06 12:18   ` Maxime Ripard
2016-09-06 14:08   ` Chen-Yu Tsai
2016-09-06 14:08     ` Chen-Yu Tsai
2016-09-07 20:37     ` Maxime Ripard
2016-09-07 20:37       ` Maxime Ripard
2016-09-07 20:37       ` Maxime Ripard

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=CAGb2v66C9GJ5Svm+7NE2cStc5KiNgoriB329K4fhZJMTSbZ8Kw@mail.gmail.com \
    --to=wens@csie.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mturquette@baylibre.com \
    --cc=mylene.josserand@free-electrons.com \
    --cc=sboyd@codeaurora.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.