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:   Mon, 20 Jun 2022 20:32:05 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Marcin Wojtas <mw@...ihalf.com>
Cc:     linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
        netdev@...r.kernel.org, rafael@...nel.org, lenb@...nel.org,
        andrew@...n.ch, vivien.didelot@...il.com, f.fainelli@...il.com,
        olteanv@...il.com, davem@...emloft.net, edumazet@...gle.com,
        kuba@...nel.org, pabeni@...hat.com, linux@...linux.org.uk,
        hkallweit1@...il.com, gjb@...ihalf.com, jaz@...ihalf.com,
        tn@...ihalf.com, Samer.El-Haj-Mahmoud@....com,
        upstream@...ihalf.com
Subject: Re: [net-next: PATCH 02/12] net: mdio: switch fixed-link PHYs API to
 fwnode_

On Mon, Jun 20, 2022 at 05:02:15PM +0200, Marcin Wojtas wrote:
> fixed-link PHYs API is used by DSA and a number of drivers
> and was depending on of_. Switch to fwnode_ so to make it
> hardware description agnostic and allow to be used in ACPI
> world as well.

...

> +bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode)
> +{
> +	struct fwnode_handle *fixed_link_node;
> +	const char *managed;
> +	int len;
> +
> +	/* New binding */
> +	fixed_link_node = fwnode_get_named_child_node(fwnode, "fixed-link");
> +	if (fixed_link_node) {
> +		fwnode_handle_put(fixed_link_node);
> +		return true;
> +	}
> +
> +	if (fwnode_property_read_string(fwnode, "managed", &managed) == 0 &&
> +	    strcmp(managed, "auto") != 0)
> +		return true;
> +
> +	/* Old binding */
> +	len = fwnode_property_read_u32_array(fwnode, "fixed-link", NULL, 0);


fwnode_property_count_u32()

> +	if (len == (5 * sizeof(u32)))

I'm not sure how to interpret this. len will return a count of u32 elements.
What does the sizeof(u32) mean here?

> +		return true;
> +
> +	return false;
> +}

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ