public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead•org>
To: Christophe JAILLET <christophe.jaillet@wanadoo•fr>
Cc: benve@cisco•com, govind@gmx•com, davem@davemloft•net,
	kuba@kernel•org, netdev@vger•kernel.org,
	linux-kernel@vger•kernel.org, kernel-janitors@vger•kernel.org
Subject: Re: [PATCH] enic: Use dma_set_mask_and_coherent()
Date: Mon, 3 Jan 2022 00:47:28 -0800	[thread overview]
Message-ID: <YdK4IIFvi5O5eXHC@infradead.org> (raw)
In-Reply-To: <f926eab883a3e5c4dbfd3eb5108b3e1828e6513b.1641045708.git.christophe.jaillet@wanadoo.fr>

On Sat, Jan 01, 2022 at 03:02:45PM +0100, Christophe JAILLET wrote:
> -	err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(47));
> +	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(47));
>  	if (err) {
> +		err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
>  		if (err) {
>  			dev_err(dev, "No usable DMA configuration, aborting\n");
>  			goto err_out_release_regions;
>  		}
>  	} else {
>  		using_dac = 1;

There is no need for the callback.  All the routines to set a DMA mask
will only fail if the passed in mask is too small, but never if it is
larger than what is supported.  Also the using_dac variable is not
needed, NETIF_F_HIGHDMA can and should be set unconditionally.

  parent reply	other threads:[~2022-01-03  8:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-01 14:02 [PATCH] enic: Use dma_set_mask_and_coherent() Christophe JAILLET
2022-01-02 12:30 ` patchwork-bot+netdevbpf
2022-01-03  8:47 ` Christoph Hellwig [this message]
2022-01-05 19:51   ` Christophe JAILLET

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=YdK4IIFvi5O5eXHC@infradead.org \
    --to=hch@infradead$(echo .)org \
    --cc=benve@cisco$(echo .)com \
    --cc=christophe.jaillet@wanadoo$(echo .)fr \
    --cc=davem@davemloft$(echo .)net \
    --cc=govind@gmx$(echo .)com \
    --cc=kernel-janitors@vger$(echo .)kernel.org \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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