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: <20230725170535.7eh7gciw4j33ds3p@skbuf>
Date:   Tue, 25 Jul 2023 20:05:35 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Minjie Du <duminjie@...o.com>
Cc:     Mark Brown <broonie@...nel.org>,
        Richard Cochran <richardcochran@...il.com>,
        "open list:FREESCALE DSPI DRIVER" <linux-spi@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:PTP HARDWARE CLOCK SUPPORT" <netdev@...r.kernel.org>,
        opensource.kernel@...o.com
Subject: Re: [PATCH v2] spi: fsl-dspi: Use dev_err_probe() in
 dspi_request_dma()

On Tue, Jul 25, 2023 at 11:50:37AM +0800, Minjie Du wrote:
> It is possible for dma_request_chan() to return EPROBE_DEFER, which means
> dev is not ready yet.
> At this point dev_err() will have no output.
> 
> Signed-off-by: Minjie Du <duminjie@...o.com>
> ---
>  drivers/spi/spi-fsl-dspi.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
> index ca41c8a8b..6aaa529b7 100644
> --- a/drivers/spi/spi-fsl-dspi.c
> +++ b/drivers/spi/spi-fsl-dspi.c
> @@ -503,15 +503,14 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
>  
>  	dma->chan_rx = dma_request_chan(dev, "rx");
>  	if (IS_ERR(dma->chan_rx)) {
> -		dev_err(dev, "rx dma channel not available\n");
> -		ret = PTR_ERR(dma->chan_rx);
> -		return ret;
> +		return dev_err_probe(dev, PTR_ERR(dma->chan_rx),
> +			"rx dma channel not available\n");

This does not have correct alignment either. Tabs are supposed to be
rendered using 8 spaces.

>  	}
>  
>  	dma->chan_tx = dma_request_chan(dev, "tx");
>  	if (IS_ERR(dma->chan_tx)) {
> -		dev_err(dev, "tx dma channel not available\n");
>  		ret = PTR_ERR(dma->chan_tx);
> +		dev_err_probe(dev, ret, "tx dma channel not available\n");
>  		goto err_tx_channel;
>  	}
>  
> -- 
> 2.39.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ