[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150721235354.GB15042@codeaurora.org>
Date: Tue, 21 Jul 2015 16:53:54 -0700
From: Stephen Boyd <sboyd@...eaurora.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, Sascha Hauer <kernel@...gutronix.de>,
Peter De Schrijver <pdeschrijver@...dia.com>,
Tero Kristo <t-kristo@...com>,
Russell King <linux@....linux.org.uk>,
Dinh Nguyen <dinguyen@...nsource.altera.com>
Subject: Re: [PATCH v5 2/8] clk: mmp: switch to GENMASK()
On 07/13, Andy Shevchenko wrote:
> diff --git a/drivers/clk/mmp/clk.h b/drivers/clk/mmp/clk.h
> index adf9b71..f5fdb0e 100644
> --- a/drivers/clk/mmp/clk.h
> +++ b/drivers/clk/mmp/clk.h
> @@ -39,7 +39,7 @@ extern struct clk *mmp_clk_register_factor(const char *name,
>
> /* Clock type "mix" */
> #define MMP_CLK_BITS_MASK(width, shift) \
> - (((1 << (width)) - 1) << (shift))
> + (GENMASK((width) - 1, 0) << (shift))
This can push the shift into the GENMASK instance too:
(GENMASK((width) - 1 + (shift), (shift))
> #define MMP_CLK_BITS_GET_VAL(data, width, shift) \
> ((data & MMP_CLK_BITS_MASK(width, shift)) >> (shift))
> #define MMP_CLK_BITS_SET_VAL(val, width, shift) \
> --
> 2.1.4
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists