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]
Message-ID: <20120618043526.GB25372@lizard>
Date:	Sun, 17 Jun 2012 21:35:26 -0700
From:	Anton Vorontsov <cbouatmailru@...il.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	David Woodhouse <dwmw2@...radead.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] power_supply: pda_power: Complain if regulator
 operations fail

On Tue, Jun 12, 2012 at 09:46:26AM +0800, Mark Brown wrote:
> Rather than silently ignoring errors from the regulator enable and disable
> add a WARN_ON() - it's probably pretty important if we're not getting
> power, though it should be vanishingly unlikely in production.
> 
> Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
> ---

Applied, thanks!

>  drivers/power/pda_power.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
> index 214468f..ed54a35 100644
> --- a/drivers/power/pda_power.c
> +++ b/drivers/power/pda_power.c
> @@ -134,13 +134,13 @@ static void update_charger(void)
>  			regulator_set_current_limit(ac_draw, max_uA, max_uA);
>  			if (!regulator_enabled) {
>  				dev_dbg(dev, "charger on (AC)\n");
> -				regulator_enable(ac_draw);
> +				WARN_ON(regulator_enable(ac_draw));
>  				regulator_enabled = 1;
>  			}
>  		} else {
>  			if (regulator_enabled) {
>  				dev_dbg(dev, "charger off\n");
> -				regulator_disable(ac_draw);
> +				WARN_ON(regulator_disable(ac_draw));
>  				regulator_enabled = 0;
>  			}
>  		}
> -- 
> 1.7.10

-- 
Anton Vorontsov
Email: cbouatmailru@...il.com
--
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