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] [day] [month] [year] [list]
Message-ID: <20191214124856.4a9e2449@cakuba.netronome.com>
Date:   Sat, 14 Dec 2019 12:48:56 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Ajay Gupta <ajaykuee@...il.com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org, treding@...dia.com,
        Ajay Gupta <ajayg@...dia.com>
Subject: Re: [PATCH v2 2/2] net: stmmac: dwc-qos: avoid clk and reset for
 acpi device

On Tue, 10 Dec 2019 23:11:25 -0800, Ajay Gupta wrote:
> From: Ajay Gupta <ajayg@...dia.com>
> 
> There are no clocks or resets referenced by Tegra ACPI device
> so don't access clocks or resets interface with ACPI device.
> 
> Clocks and resets for ACPI devices will be handled via ACPI
> interface.
> 
> Signed-off-by: Ajay Gupta <ajayg@...dia.com>
> ---
> Change from v1->v2: Rebased.
> 
>  .../stmicro/stmmac/dwmac-dwc-qos-eth.c        | 122 ++++++++++--------
>  1 file changed, 67 insertions(+), 55 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> index f87306b3cdae..70e8c41f7761 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> @@ -272,6 +272,7 @@ static void *tegra_eqos_probe(struct platform_device *pdev,
>  			      struct stmmac_resources *res)
>  {
>  	struct tegra_eqos *eqos;
> +	struct device *dev = &pdev->dev;
>  	int err;

Looks like this file uses reverse xmas tree variable ordering (longest
to shortest total line length), please comply and add the dev first.

>  	eqos = devm_kzalloc(&pdev->dev, sizeof(*eqos), GFP_KERNEL);
> @@ -283,77 +284,88 @@ static void *tegra_eqos_probe(struct platform_device *pdev,
>  	eqos->dev = &pdev->dev;
>  	eqos->regs = res->addr;
>  
> -	eqos->clk_master = devm_clk_get(&pdev->dev, "master_bus");
> -	if (IS_ERR(eqos->clk_master)) {
> -		err = PTR_ERR(eqos->clk_master);
> -		goto error;
> -	}
> +	if (is_of_node(dev->fwnode)) {
> +		eqos->clk_master = devm_clk_get(&pdev->dev, "master_bus");
> +		if (IS_ERR(eqos->clk_master)) {
> +			err = PTR_ERR(eqos->clk_master);
> +			goto error;
> +		}

You're indenting most of this function (~70 lines?) Would it be
possible to move this code out into a separate function?

[..]
> +	} else {
> +		/* set clk and reset handle to NULL for non DT device */
> +		eqos->clk_master = NULL;
> +		eqos->clk_slave = NULL;
> +		data->stmmac_clk = NULL;
> +		eqos->clk_rx = NULL;
> +		eqos->clk_tx = NULL;
> +		eqos->reset = NULL;

Not sure about data, but eqos is zalloced so there should be no need to
set the pointers to NULL.

> +	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ