On Thu, Mar 19, 2015 at 04:33:12PM +0000, John Harrison wrote: > On 19/03/2015 15:16, Jani Nikula wrote: > >On Thu, 19 Mar 2015, "Daniel, Thomas" <thomas.daniel@xxxxxxxxx> wrote: > >>>- if (&request->list == &ring->request_list) > >>>+ /* It should always be possible to find a suitable request! */ > >>>+ if (&request->list == &ring->request_list) { > >>>+ WARN_ON(true); > >>> return -ENOSPC; > >>>+ } > >>Don’t we normally say > >> if (WARN_ON(&request->list == &ring->request_list)) > >> return -ENOSPC; > >Yes, particularly since we've amended WARN_ON within i915 to print out > >the condition that failed. "true" is not very useful with that. ;) > > > >BR, > >Jani. > > > The issue I have with 'if(WARN_ON(x))' is that it looks like something that > would disappear in a non debugging build. Whereas, this is a check that > wants to exist regardless of build options. Yeah kernel isn't like that, WARN_ON is always executed. We rely on that all over the place actually by sometimes wrapping full function-calls with side-effects with a WARN_ON for cases we don't expect anything to ever fail. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx