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:   Fri, 17 Nov 2017 12:41:05 +0530
From:   Vinod Koul <vinod.koul@...el.com>
To:     srinivas.kandagatla@...aro.org
Cc:     gregkh@...uxfoundation.org, broonie@...nel.org,
        alsa-devel@...a-project.org, mark.rutland@....com,
        michael.opdenacker@...e-electrons.com, poeschel@...onage.de,
        andreas.noever@...il.com, arnd@...db.de, bp@...e.de,
        devicetree@...r.kernel.org, james.hogan@...tec.com,
        pawel.moll@....com, linux-arm-msm@...r.kernel.org,
        sharon.dvir1@...l.huji.ac.il, robh+dt@...nel.org,
        sdharia@...eaurora.org, alan@...ux.intel.com, treding@...dia.com,
        mathieu.poirier@...aro.org, jkosina@...e.cz,
        linux-kernel@...r.kernel.org, daniel@...ll.ch, joe@...ches.com,
        davem@...emloft.net
Subject: Re: [alsa-devel] [PATCH v7 05/13] slimbus: core: add support to
 device tree helper

On Wed, Nov 15, 2017 at 02:10:35PM +0000, srinivas.kandagatla@...aro.org wrote:
> +
> +	for_each_child_of_node(ctrl->dev->of_node, node) {
> +		struct slim_device *sbdev;
> +		struct slim_eaddr e_addr;
> +		const char *compat = NULL;
> +		int reg[2], ret;
> +		int manf_id, prod_code;
> +
> +		compat = of_get_property(node, "compatible", NULL);
> +		if (!compat)
> +			continue;
> +
> +		ret = sscanf(compat, "slim%x,%x", &manf_id, &prod_code);
> +		if (ret != 2) {
> +			dev_err(dev, "Manf ID & Product code not found %s\n",
> +				compat);
> +			continue;
> +		}

can we do xxx_property_read_u32() on compat and then use bit manupliations
to get ids rather than scanf.

> +
> +		ret = of_property_read_u32_array(node, "reg", reg, 2);

I typically prefer using device_property_read_u32() but then this is of_
code so I will leave this upto you...

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ