From: Chris Ball <cjb@laptop.org>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andrei Warkentin <andreiw@vmware.com>,
linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] mmc: sh_mmcif: simplify clock divisor calculation
Date: Thu, 01 Dec 2011 13:24:20 -0500 [thread overview]
Message-ID: <87ehwokv57.fsf@laptop.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1111231551100.5635@axis700.grange> (Guennadi Liakhovetski's message of "Wed, 23 Nov 2011 15:52:30 +0100 (CET)")
Hi,
On Wed, Nov 23 2011, Guennadi Liakhovetski wrote:
> Replace ilog2(__rounddown_pow_of_two(x)) with the equivalent but much
> simpler fls(x) - 1.
>
> Reported-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
> drivers/mmc/host/sh_mmcif.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index c021482..824fee5 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -16,6 +16,7 @@
> *
> */
>
> +#include <linux/bitops.h>
> #include <linux/clk.h>
> #include <linux/completion.h>
> #include <linux/delay.h>
> @@ -386,7 +387,7 @@ static void sh_mmcif_clock_control(struct sh_mmcif_host *host, unsigned int clk)
> sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_SUP_PCLK);
> else
> sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_CLEAR &
> - (ilog2(__rounddown_pow_of_two(host->clk / clk)) << 16));
> + ((fls(host->clk / clk) - 1) << 16));
>
> sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_ENABLE);
> }
Thanks, pushed to mmc-next for 3.3.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
WARNING: multiple messages have this Message-ID (diff)
From: Chris Ball <cjb@laptop.org>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andrei Warkentin <andreiw@vmware.com>,
linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] mmc: sh_mmcif: simplify clock divisor calculation
Date: Thu, 01 Dec 2011 18:24:20 +0000 [thread overview]
Message-ID: <87ehwokv57.fsf@laptop.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1111231551100.5635@axis700.grange> (Guennadi Liakhovetski's message of "Wed, 23 Nov 2011 15:52:30 +0100 (CET)")
Hi,
On Wed, Nov 23 2011, Guennadi Liakhovetski wrote:
> Replace ilog2(__rounddown_pow_of_two(x)) with the equivalent but much
> simpler fls(x) - 1.
>
> Reported-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
> drivers/mmc/host/sh_mmcif.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index c021482..824fee5 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -16,6 +16,7 @@
> *
> */
>
> +#include <linux/bitops.h>
> #include <linux/clk.h>
> #include <linux/completion.h>
> #include <linux/delay.h>
> @@ -386,7 +387,7 @@ static void sh_mmcif_clock_control(struct sh_mmcif_host *host, unsigned int clk)
> sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_SUP_PCLK);
> else
> sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_CLEAR &
> - (ilog2(__rounddown_pow_of_two(host->clk / clk)) << 16));
> + ((fls(host->clk / clk) - 1) << 16));
>
> sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_ENABLE);
> }
Thanks, pushed to mmc-next for 3.3.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2011-12-01 18:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 19:56 [PATCH] include/log2.h: Fix rounddown_pow_of_two(1) Andrei Warkentin
2011-11-16 22:51 ` Rolf Eike Beer
2011-11-17 23:05 ` Andrew Morton
2011-11-17 23:19 ` [opensuse-kernel] " Cristian Rodríguez
2011-11-17 23:32 ` Andrew Morton
2011-11-18 18:46 ` Andrei Warkentin
2011-11-19 9:26 ` Marco Stornelli
2011-11-22 23:34 ` Guennadi Liakhovetski
2011-11-23 14:52 ` [PATCH] mmc: sh_mmcif: simplify clock divisor calculation Guennadi Liakhovetski
2011-11-23 14:52 ` Guennadi Liakhovetski
2011-12-01 18:24 ` Chris Ball [this message]
2011-12-01 18:24 ` Chris Ball
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=87ehwokv57.fsf@laptop.org \
--to=cjb@laptop.org \
--cc=akpm@linux-foundation.org \
--cc=andreiw@vmware.com \
--cc=g.liakhovetski@gmx.de \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.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 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.