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: <2819989.unjINxCo2S@wuerfel>
Date:	Tue, 08 Dec 2015 10:35:05 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Phil Reid <preid@...ctromag.com.au>
Cc:	robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
	ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
	peppe.cavallaro@...com, davem@...emloft.net,
	vbridger@...nsource.altera.com, devicetree@...r.kernel.org,
	netdev@...r.kernel.org
Subject: Re: [PATCH v3 1/4] stmmac: create of compatible mdio bus for stmacc driver

On Tuesday 08 December 2015 13:12:59 Phil Reid wrote:

> @@ -201,6 +201,25 @@ int stmmac_mdio_register(struct net_device *ndev)
>  	struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data;
>  	int addr, found;
>  
> +#ifdef CONFIG_OF
> +	struct device_node *mdio_node = NULL;
> +	struct device_node *child_node = NULL;
> +
> +	for_each_child_of_node(priv->device->of_node, child_node) {
> +		if (of_device_is_compatible(child_node, "snps,dwmac-mdio")) {
> +			mdio_node = child_node;
> +			break;
> +		}
> +	}

Can you use "if (IS_ENABLED(CONFIG_OF))" here instead of a preprocessor "#if"?

> @@ -231,7 +250,11 @@ int stmmac_mdio_register(struct net_device *ndev)
>  	new_bus->irq = irqlist;
>  	new_bus->phy_mask = mdio_bus_data->phy_mask;
>  	new_bus->parent = priv->device;
> +#ifdef CONFIG_OF
> +	err = of_mdiobus_register(new_bus, mdio_node);
> +#else
>  	err = mdiobus_register(new_bus);
> +#endif

This looks like it should be done in the header file. Can you make
a separate patch that changes the header file declaring of_mdiobus_register
to make it a static inline function calling mdiobus_register() if CONFIG_OF
is disabled?

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ