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]
Date:   Tue, 29 May 2018 12:47:40 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc:     mturquette@...libre.com, sboyd@...nel.org, robh+dt@...nel.org,
        mark.rutland@....com, lee.jones@...aro.org, lgirdwood@...il.com,
        mazziesaccount@...il.com, linux-clk@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        mikko.mutanen@...rohmeurope.com, heikki.haikola@...rohmeurope.com
Subject: Re: [PATCH v3 6/6] regulator: bd71837: BD71837 PMIC regulator driver

On Tue, May 29, 2018 at 01:02:15PM +0300, Matti Vaittinen wrote:

> @@ -0,0 +1,677 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/* Copyright (C) 2018 ROHM Semiconductors */
> +/*
> + * bd71837-regulator.c ROHM BD71837MWV regulator driver
> + */

The SPDX header (and the rest of the block) need to be C++ comments.

> +static int bd71837_regulator_set_regmap(struct regulator_dev *rdev, int set)
> +{
> +	int ret = -EINVAL;
> +	struct bd71837_pmic *pmic = rdev->reg_data;
> +
> +	/* According to the data sheet we must not change regulator voltage
> +	 * when it is enabled. Thus we need to check if regulator is enabled
> +	 * before changing the voltage. This mutex is used to avoid race where
> +	 * we might enable regulator after it's state has been checked but
> +	 * before the voltage is changed
> +	 */
> +	mutex_lock(&pmic->mtx);
> +	if (!set)
> +		ret = regulator_disable_regmap(rdev);
> +	else
> +		ret = regulator_enable_regmap(rdev);
> +	mutex_unlock(&pmic->mtx);
> +

This still has the weird locking/wrapper thing going on.  The regulator
core will ensure that only one operation is called on a given regulator
at once.

> +static const struct regulator_desc bd71837_regulators[] = {
> +	{
> +	 .name = "buck1",

The indentation style here is weird, please follow CodingStyle.  Looks
like the second level is just indented by a space for some reason, and
there's similar problems elsewhere.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ