lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150721234807.GA15042@codeaurora.org>
Date:	Tue, 21 Jul 2015 16:48:07 -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 1/8] clk: divider: switch to GENMASK()

On 07/13, Andy Shevchenko wrote:
> Convert the code to use GENMASK() helper instead of div_mask() macro.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/clk/clk-divider.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
> index 706b578..3bde790 100644
> --- a/drivers/clk/clk-divider.c
> +++ b/drivers/clk/clk-divider.c
> @@ -30,8 +30,6 @@
>  

#include <linux/bitops.h> ?

> @@ -391,10 +389,10 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
>  		spin_lock_irqsave(divider->lock, flags);
>  
>  	if (divider->flags & CLK_DIVIDER_HIWORD_MASK) {
> -		val = div_mask(divider->width) << (divider->shift + 16);
> +		val = GENMASK(divider->width - 1, 0) << (divider->shift + 16);
>  	} else {
>  		val = clk_readl(divider->reg);
> -		val &= ~(div_mask(divider->width) << divider->shift);
> +		val &= ~(GENMASK(divider->width - 1, 0) << divider->shift);

Shouldn't this be doing the shift in the GENMASK?

	start = divider->width - 1 + divider->shift;
	end = divider->shift;

	...

		val &= ~GENMASK(start, end);

-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ