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: <CACRpkdaBuwqGPbfLK8bR5A4NSefifw8VqPyUbgtAtweqoEnD7g@mail.gmail.com>
Date:   Mon, 22 Aug 2016 15:45:48 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Andrew Jeffery <andrew@...id.au>
Cc:     Joel Stanley <joel@....id.au>,
        Alexandre Courbot <gnurou@...il.com>,
        Mark Rutland <mark.rutland@....com>,
        Rob Herring <robh+dt@...nel.org>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Jeremy Kerr <jk@...abs.org>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 5/8] pinctrl: Add core support for Aspeed SoCs

On Fri, Aug 19, 2016 at 2:44 PM, Andrew Jeffery <andrew@...id.au> wrote:

> +++ b/drivers/pinctrl/aspeed/Kconfig
> @@ -0,0 +1,8 @@
> +config PINCTRL_ASPEED
> +       bool
> +       depends on (ARCH_ASPEED || COMPILE_TEST) && OF
> +       select PINMUX
> +       select PINCONF
> +       select GENERIC_PINCONF
> +       select MFD_SYSCON
> +       select REGMAP_MMIO

Since this device is spawn from the syscon, should it not be
"depends on MFD_SYSCON"?

(No big deal, if you think this is right then go with it.)

> +#include <linux/io.h>

What is this include for?

> +#include <linux/mfd/syscon.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>
> +#include <linux/string.h>
> +#include "../core.h"
> +#include "pinctrl-aspeed.h"

No #include <linux/regmap.h>?

Maybe some #includes are centralized to pinctrl-aspeed.h
I don't know, just make sure you don't have implicit includes.

> +               if (regmap_read(map, desc->reg, &val) < 0)
> +                       return false;
> +
> +               val &= ~desc->mask;
> +               val |= pattern << __ffs(desc->mask);
> +
> +               if (regmap_write(map, desc->reg, val) < 0)
> +                       return false;

Use:

regmap_update_bits(map,
                              desc->reg,
                              desc->mask,
                              pattern << __ffs->desc->mask);

Or something like that instead of reimplementing
mask-and-set. Regmap already knows how to do the
business.

(Applied everywhere in the driver where you have a
mask-and-set like this).

The expression core engine is still a complete mystery
for me, I will just trust you that it works as intended.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ