netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Marin Mitov <mitov@issp.bas.bg>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: pci_set_consistent_dma_mask() question
Date: Sun, 25 May 2008 11:59:36 -0700	[thread overview]
Message-ID: <20080525115936.7dbf2ecd@infradead.org> (raw)
In-Reply-To: <200805250843.47179.mitov@issp.bas.bg>

On Sun, 25 May 2008 08:43:47 +0300
Marin Mitov <mitov@issp.bas.bg> wrote:

> Hi all,
> 
> In the file: Documentation/DMA-mapping.txt is written:
> 
> pci_set_consistent_dma_mask() will always be able to set the same or a
> smaller mask as pci_set_dma_mask(). However for the rare case that a
> device driver only uses consistent allocations, one would have to
> check the return value from pci_set_consistent_dma_mask().
> 
> grep-ing drivers/net/* shows that in many drivers 
> the return value of pci_set_consistent_dma_mask() is checked
> in the path where pci_set_dma_mask() was already successfull.
> Sure, this is during driver's initiallysation, so it is not time
> critical.
> 
> My question: Is it worth to remove the unnecessary checks?
> I could prepare patches if you find it worthfull.
> 

I think it would actually be harmful. Checking for errors even if they
shouldn't happen for things like this makes drivers better! If something
weird is going on it gets detected earlier... IN general, defensive
programming makes a lot of sense.

      reply	other threads:[~2008-05-25 18:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-25  5:43 pci_set_consistent_dma_mask() question Marin Mitov
2008-05-25 18:59 ` Arjan van de Ven [this message]

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=20080525115936.7dbf2ecd@infradead.org \
    --to=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitov@issp.bas.bg \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).