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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Jun 2018 16:58:43 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc:     Michael Turquette <mturquette@...libre.com>,
        Stephen Boyd <sboyd@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Lee Jones <lee.jones@...aro.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>, mazziesaccount@...il.com,
        linux-clk@...r.kernel.org, devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <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 1:02 PM, Matti Vaittinen
<matti.vaittinen@...rohmeurope.com> wrote:
> Support for controlling the 8 bucks and 7 LDOs the PMIC contains.

> +#include <linux/kernel.h>

> +#include <linux/module.h>
> +#include <linux/init.h>

One of these is redundant.

> +#include <linux/err.h>
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/regulator/driver.h>
> +#include <linux/regulator/machine.h>
> +#include <linux/delay.h>
> +#include <linux/slab.h>
> +#include <linux/gpio.h>
> +#include <linux/mfd/bd71837.h>
> +#include <linux/regulator/of_regulator.h>

Can you keep the list ordered?

> +       dev_dbg(&(pmic->pdev->dev), "Buck[%d] Set Ramp = %d\n", id + 1,
> +               ramp_delay);

Redundant parens.

> +static int bd71837_regulator_set_regmap(struct regulator_dev *rdev, int set)
> +{

> +       int ret = -EINVAL;

Redundant assignment.

> +       if (!set)
> +               ret = regulator_disable_regmap(rdev);
> +       else
> +               ret = regulator_enable_regmap(rdev);

> +       return ret;
> +}

> +static int bd71837_probe(struct platform_device *pdev)
> +{

> +       pmic = devm_kzalloc(&pdev->dev, sizeof(struct bd71837_pmic),
> +                           GFP_KERNEL);

sizeof(*pmic) and one line as result?

> +       if (!pmic)
> +               return -ENOMEM;

> +       if (!pmic->mfd) {
> +               dev_err(&pdev->dev, "No MFD driver data\n");

> +               err = -EINVAL;
> +               goto err;

Plain return?

> +       }

> +               dev_dbg(&pmic->pdev->dev, "%s: Unlocked lock register 0x%x\n",
> +                       __func__, BD71837_REG_REGLOCK);

__func__ part is redundant.

> +       for (i = 0; i < ARRAY_SIZE(pmic_regulator_inits); i++) {

> +

Redundant blank line.

> +               rdev = devm_regulator_register(&pdev->dev, desc, &config);
> +               if (IS_ERR(rdev)) {
> +                       dev_err(pmic->mfd->dev,
> +                               "failed to register %s regulator\n",
> +                               desc->name);

> +                       err = PTR_ERR(rdev);
> +                       goto err;

Plain return ...

> +err:
> +       return err;

Redundant.

> +}

> +static struct platform_driver bd71837_regulator = {
> +       .driver = {
> +                  .name = "bd71837-pmic",

> +                  .owner = THIS_MODULE,

This done by macro you are using below. Thus, redundant.

> +                  },
> +       .probe = bd71837_probe,
> +};
> +
> +module_platform_driver(bd71837_regulator);

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ