mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: perex@perex.cz, tiwai@suse.com, leon@kernel.org,
	broonie@kernel.org, joe@perches.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: intel_hdmi: Check for error num after setting mask
Date: Thu, 06 Jan 2022 09:18:01 +0100	[thread overview]
Message-ID: <s5hv8yxgtvq.wl-tiwai@suse.de> (raw)
In-Reply-To: <20220106012428.2504003-1-jiasheng@iscas.ac.cn>

On Thu, 06 Jan 2022 02:24:28 +0100,
Jiasheng Jiang wrote:
> 
> As the dma_supported() may fail, the dma_set_mask_and_coherent() may
> fail too.
> Therefore, it should be better to check it and return error if fails.
> 
> Fixes: da8648097497 ("ALSA: x86: Flatten two abstraction layers")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>

Well, 32bit DMA mask practically never fails on x86 (and other
architectures, IIRC).  It's fine to add a sanity check, but it's
better to be mentioned that it never fails.


thanks,

Takashi

> ---
>  sound/x86/intel_hdmi_audio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
> index 33b12aa67cf5..6caea517f07f 100644
> --- a/sound/x86/intel_hdmi_audio.c
> +++ b/sound/x86/intel_hdmi_audio.c
> @@ -1770,7 +1770,9 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
>  	card_ctx->irq = irq;
>  
>  	/* only 32bit addressable */
> -	dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> +	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> +	if (ret)
> +		goto err;
>  
>  	init_channel_allocations();
>  
> -- 
> 2.25.1
> 

  reply	other threads:[~2022-01-06  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06  1:24 Jiasheng Jiang
2022-01-06  8:18 ` Takashi Iwai [this message]
2022-01-06  8:41 Jiasheng Jiang
2022-01-06  9:34 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hv8yxgtvq.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jiasheng@iscas.ac.cn \
    --cc=joe@perches.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®