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] [day] [month] [year] [list]
Date:   Tue, 27 Mar 2018 13:12:32 +0100
From:   Lee Jones <lee.jones@...aro.org>
To:     Daniel Schultz <d.schultz@...tec.de>
Cc:     zyw@...k-chips.com, zhangqing@...k-chips.com, xsf@...k-chips.com,
        tony.xie@...k-chips.com, w.egorov@...tec.de,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] mfd: rk808: Refactor shutdown functions

On Fri, 16 Mar 2018, Daniel Schultz wrote:

> Since all three shutdown functions have almost the same code, all logic
> from the shutdown functions can be refactored to a new function
> "rk808_update_bits", which can update a register by a given address and
> bitmask.
> 
> Signed-off-by: Daniel Schultz <d.schultz@...tec.de>
> ---
> Changes:
> 	v2: Re-submit with recipients from Rockchip.
> 	v3: - Added devicetree property to enable the PMIC reset seperate from 
> 	      "rockchip,system-power-controller".
> 	    - Dropped the first patch of this serie.
> 	v4: Splitted refactoring and the new reset feature.
> 
>  drivers/mfd/rk808.c | 47 ++++++++++++++---------------------------------
>  1 file changed, 14 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
> index 216fbf6..ae014ee 100644
> --- a/drivers/mfd/rk808.c
> +++ b/drivers/mfd/rk808.c
> @@ -369,58 +369,39 @@ static const struct regmap_irq_chip rk818_irq_chip = {
>  
>  static struct i2c_client *rk808_i2c_client;
>  
> -static void rk805_device_shutdown(void)
> +static void rk808_update_bits(unsigned int reg, unsigned int bit_mask)
>  {
>  	int ret;
>  	struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
>  
>  	if (!rk808) {
>  		dev_warn(&rk808_i2c_client->dev,
> -			 "have no rk805, so do nothing here\n");
> +			 "have no %s, so do nothing here\n",
> +			 rk808->regmap_irq_chip->name);

Julia is right, you can't do this.

If !rk808 you will not be able to deference it.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ