Re: [PATCH] drm/gem-cma-helper: Change the level of the allocation failure message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday, 2017-10-05 10:57:47 +0200, Boris Brezillon wrote:
> On Thu, 5 Oct 2017 09:48:24 +0100
> Eric Engestrom <eric.engestrom@xxxxxxxxxx> wrote:
> 
> > On Wednesday, 2017-10-04 22:28:54 +0000, Eric Anholt wrote:
> > > Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx>  
> > > 
> > > 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.

Definitely, the function you're touching just happens to be a user of
this potential new attribute.

IMO just drop the header part of the change, and this is
Reviewed-by: Eric Engestrom <eric.engestrom@xxxxxxxxxx>

On the sparse attribute discussion, anyone knows someone with experience
doing that?
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux