All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/gem-cma-helper: Change the level of the allocation failure message
Date: Thu, 5 Oct 2017 10:57:47 +0200	[thread overview]
Message-ID: <20171005105747.4a4d197e@bbrezillon> (raw)
In-Reply-To: <20171005084824.ti6oi7veo4bn7t3s@imgtec.com>

On Thu, 5 Oct 2017 09:48:24 +0100
Eric Engestrom <eric.engestrom@imgtec.com> wrote:

> On Wednesday, 2017-10-04 22:28:54 +0000, Eric Anholt wrote:
> > Boris Brezillon <boris.brezillon@free-electrons.com> writes:
> >   
> > > drm_gem_cma_create() prints an error message when dma_alloc_wc() fails to
> > > allocate the amount of memory we requested. This can lead to annoying
> > > error messages when CMA is only one possible source of memory for the BO
> > > allocation.
> > >
> > > Turn this error message into a debug one and add a __must_check specifier
> > > to make sure all callers are checking the return value.
> > >
> > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>  
> > 
> > The __must_check seems unnecessary to me -- you're definitely going to
> > be doing something with the return value, because otherwise why did you
> > call the object allocate function?  
> 
> Indeed, `__must_check` (aka `warn_unused_result`) only makes sure the
> return value is not discarded, which will probably always be true here.

I agree, this __must_check is not really useful here.

> 
> > The `warn_unused_result` attribute causes a warning to be emitted if
> > a caller of the function with this attribute does not use its return
> > value.  
> 
> I think we need a sparse attribute to check that the return value is
> IS_ERR()-checked?

Can we just turn the dev_err() into dev_dbg() for now? The 'force
callers to check IS_ERR()' is kind of orthogonal to the change I'm
doing here.

> (not volunteering, I have no idea how to add a sparse attribute :)

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-10-05  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 13:08 [PATCH] drm/gem-cma-helper: Change the level of the allocation failure message Boris Brezillon
2017-10-04 16:10 ` Daniel Vetter
2017-10-04 22:28 ` Eric Anholt
2017-10-05  8:48   ` Eric Engestrom
2017-10-05  8:57     ` Boris Brezillon [this message]
2017-10-05  9:13       ` Eric Engestrom

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=20171005105747.4a4d197e@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric.engestrom@imgtec.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.